(aws-s3-deployment): Allow ability to specify versionId for S3 bucket source
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Allow user to specify optional versionId of the zipped file for the s3 bucket source type.
### Use Case
We are using versioning on our s3 bucket and replacing the same file, but want to use versionId instead of having to create duplicate files to deploy to our cloudfront s3 bucket.
Versioning is extremely important for use case, since we use it for lifecycle retention policy purposes (with keep last N versions).
### Proposed Solution
```
new s3Deploy.BucketDeployment(this, 'bucket-deployment', {
sources: [
s3Deploy.Source.bucket(sourceBucket, sourceKey, {versionId: '3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo'}),
```
where versionId is optional.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.170.0
### Environment details (OS name and version, etc.)
MacOS 14.6.1
Contributor guide
Research direction
Start by tracing the s3Deploy.Source.bucket entry point and how BucketDeployment handles S3 bucket sources. Confirm how the optional versionId should flow into source selection, then verify that deployments can select the requested object version while existing calls without versionId continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100