Skip to content

(aws-s3-deployment): support for corss-region BucketDeployment similar to S3 Sync #34858

@arbzkhan

Description

@arbzkhan

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions