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:
Give the aws_s3_deployment construct a bundling parameter which could act the same as the aws_s3_assets.
Create a type of "Asset Bundling" construct, which could then be passed as a source to aws_s3_assets - the retroactively update
Proposed Solution
aws_s3_assets needs a bucket property, that will override its bundled destination target.
Update sources on aws_s3_deployment to be able to take an aws_s3_assets as a target. If it is passed a aws_s3_asset then it should set the bucket property for it, based in the bucket 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 the BucketDeployment overrides the Assets new bucket property (done via setter when the deployment is constructed
Scenario 2: Giving Asset a specified bucket.
In this example giving Asset a bucket, would put all built assets into the websiteBucket as opposed to the CDK managed one.
Hi @myerscf , thanks for reaching out with this request. Yes, it would be a good addItion to have such prop in AssetProps or any other alternate provided.
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 givingAsset
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