Skip to content

feat(s3-deployment): add destinationBucketRegion prop for cross-region deployments - #38200

Open
bentorb wants to merge 2 commits into
aws:mainfrom
bentorb:feat/s3-deployment-destination-bucket-region
Open

feat(s3-deployment): add destinationBucketRegion prop for cross-region deployments#38200
bentorb wants to merge 2 commits into
aws:mainfrom
bentorb:feat/s3-deployment-destination-bucket-region

Conversation

@bentorb

@bentorb bentorb commented Jun 25, 2026

Copy link
Copy Markdown

Issue

Closes #34858.

Reason for this change

When deploying to an S3 bucket in a different region than the Lambda's execution region — particularly opt-in regions like eu-south-2 or ap-east-1 — the AWS CLI commands (s3 sync, s3 cp, s3 rm) default to the Lambda's region and fail with IllegalLocationConstraintException.

Description of changes

Adds a destinationBucketRegion optional prop to BucketDeployment. When specified, the value is passed as --region to all AWS CLI commands in the Lambda handler (s3 sync, s3 cp, s3 rm). This allows the handler to operate on buckets in any region regardless of where the Lambda itself is running.

Describe any new or updated permissions being added

No new IAM permissions required.

Description of how you validated changes

  • Unit tests added for destinationBucketRegion specified and not specified (bucket-deployment.test.ts)
  • Python handler unit tests added for create/update and delete with DestinationBucketRegion (test.py, run via Docker)
  • Integration test added (integ.bucket-deployment-cross-region.ts) covering 10 scenarios across standard and opt-in regions (us-east-1, us-west-2, eu-south-2)
  • Integration test deployed and validated end-to-end with eu-south-2 opted in
  • All 26 existing aws-s3-deployment integration snapshots verified UNCHANGED
  • All other affected module snapshots (12 modules) verified UNCHANGED
  • Rosetta (README compile check) passes

Note: The integration test deploys to eu-south-2, which is an opt-in region. Running yarn integ (not dry-run) requires that region to be enabled on the target AWS account.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Jun 25, 2026
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 4688b0d to f118520 Compare June 25, 2026 08:14
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from f118520 to 118d733 Compare June 25, 2026 13:56
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 118d733 to 06837ff Compare June 26, 2026 11:34
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 06837ff to ef4b492 Compare June 26, 2026 13:32
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from ef4b492 to 1e6387a Compare June 27, 2026 12:44
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 1e6387a to 7b5101b Compare June 29, 2026 15:09
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 7b5101b to 7fb92e8 Compare June 29, 2026 16:40
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 7fb92e8 to 6e39d8c Compare July 1, 2026 07:53
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 5031295 to 9b729f4 Compare July 12, 2026 08:05
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 9b729f4 to 59f06b2 Compare July 19, 2026 13:09
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from 59f06b2 to acad3eb Compare July 20, 2026 13:12
@bentorb
bentorb force-pushed the feat/s3-deployment-destination-bucket-region branch from acad3eb to a2c284c Compare July 21, 2026 09:04
bentorb and others added 2 commits July 31, 2026 16:06
…n deployments

Adds a `destinationBucketRegion` prop to `BucketDeployment` that passes
`--region` to the underlying AWS CLI commands (s3 sync, s3 cp, s3 rm) in
the Lambda handler. This enables deployments to buckets in regions other
than the Lambda's execution region, including opt-in regions such as
eu-south-2.
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

9 similar comments
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants