(aws-s3-deployment): support for corss-region BucketDeployment similar to S3 Sync
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Currently, while using the 'BucketDeployment' CDK construct[1], which copies files from a source S3 bucket to a destination S3 bucket, works perfectly within the same region. However, when customers need to copy files to a cross-region S3 bucket, they encounter the below error, which is expected because there is no opt-in region property for this construct.
___
"An error occurred (IllegalLocationConstraintException) when calling the ListObjectsV2 operation: The "region-name" location constraint is incompatible for the region specific endpoint this request was sent to."
___
[1] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_deployment.BucketDeployment.html#destinationbucket
### Use Case
To achieve this use-case either customers need to create a stack in specific region itself or need to use "aws s3 sync" CLI command[2].
[2] https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
### Proposed Solution
Add a new optional property 'region' to the BucketDeployment construct to allow users to specify the destination region for cross-region deployments
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
2.161.0
### AWS CDK CLI version
2.1019.1
### Environment details (OS name and version, etc.)
OSX
Contributor guide
Research direction
Start with the BucketDeployment construct and its destinationBucket behavior, then compare the cross-region requirements with the linked AWS CLI s3 sync reference. Done means an optional region setting allows deployment to a destination bucket in another region without the reported location-constraint error; identify the relevant construct tests and documentation while tracing the implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100