(aws_s3): add asset bundling functionality to aws_s3_deployment #27214
Labels
@aws-cdk/aws-s3
Related to Amazon S3
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Extend the functionality of S3 Assets - Asset Bundling functionality, to be able to build and bundle resources but pass them to a custom target, as an opposed to a CDK managed S3 bucket.
Use Case
Use this functionality in collaboration with other resources such as the S3 Deployment construct, in order to create robust deployment of application managed resources such as front end assets and media content.
Alternative Options:
aws_s3_deployment
construct abundling
parameter which could act the same as theaws_s3_assets
.source
toaws_s3_assets
- the retroactively updateProposed Solution
aws_s3_assets
needs abucket
property, that will override its bundled destination target.Update
sources
onaws_s3_deployment
to be able to take anaws_s3_assets
as a target. If it is passed aaws_s3_asset
then it should set the bucket property for it, based in thebucket
value of the deployment.This implementation would not cause any BCs, as it would only take effect if the user overrides the
bucket
property. If omitted,aws_s3_assets
would continue as normal to push to a CDK managed bucket.Other Information
Scenario 1: Creating an asset and giving it to a
BucketDeployment
.In this example giving the
builtAsset
to theBucketDeployment
overrides theAsset
s newbucket
property (done via setter when the deployment is constructedScenario 2: Giving
Asset
a specified bucket.In this example giving
Asset
a bucket, would put all built assets into thewebsiteBucket
as opposed to the CDK managed one.Acknowledgements
CDK version used
2.96.2
Environment details (OS name and version, etc.)
OSX Ventura 13.5.2
The text was updated successfully, but these errors were encountered: