Skip to content

Conversation

bentorb
Copy link

@bentorb bentorb commented Oct 8, 2025

Fixes #34858

This PR adds support for cross-region S3 deployments by introducing an optional destinationBucketRegion parameter to the BucketDeployment construct.

Motivation

Cross-region S3 deployments currently fail when deploying from opt-in AWS regions (like eu-south-2) because the Lambda handler does not include de --region required in the S3 CLI operations.

Solution

  • Add optional destinationBucketRegion parameter to BucketDeploymentProps
  • Pass the destination region to the Lambda handler via custom resource properties
  • Extract the destination region parameter in the Python handler and use it in S3 CLI commands
  • Maintain backward compatibility (defaults to current behavior when parameter is omitted)

Testing

  • Added new unit-tests
  • Added comprehensive integration tests covering 8 cross-region deployment scenarios
  • Tests validate deployments across us-east-1, us-west-2, and eu-south-2
  • All integration tests pass successfully

Breaking Changes

None - this is a backward-compatible feature addition.


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

…region deployments

- Add destinationBucketRegion parameter to BucketDeployment construct
- Fix cross-region S3 deployments to opt-in regions like eu-south-2
- Update Lambda handler to use correct region for S3 operations
- Add comprehensive integration tests covering 8 cross-region scenarios
- Validate deployments across us-east-1, us-west-2, and eu-south-2

Fixes cross-region deployment failures when deploying to regions that require explicit opt-in.
@bentorb bentorb had a problem deploying to deployment-integ-test October 8, 2025 19:40 — with GitHub Actions Error
@aws-cdk-automation aws-cdk-automation requested a review from a team October 8, 2025 19:40
@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 Oct 8, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@bentorb bentorb had a problem deploying to deployment-integ-test October 8, 2025 19:46 — with GitHub Actions Error
@bentorb bentorb had a problem deploying to deployment-integ-test October 8, 2025 20:08 — with GitHub Actions Error
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 8, 2025 20:10

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

…n deployment

- Add test cases 9 and 10 for eu-south-2 to us-west-2 cross-region scenarios
- Test both with and without destinationBucketRegion parameter specified
- Update integration test snapshots with new CloudFormation templates
- Validate cross-region deployment functionality works correctly
@bentorb bentorb had a problem deploying to deployment-integ-test October 9, 2025 08:11 — with GitHub Actions Error
@bentorb bentorb had a problem deploying to deployment-integ-test October 9, 2025 09:56 — with GitHub Actions Error
@bentorb bentorb had a problem deploying to deployment-integ-test October 9, 2025 11:42 — with GitHub Actions Error
…ption

Replace the existing description for destinationBucketRegion with a more detailed one.
@bentorb bentorb had a problem deploying to deployment-integ-test October 9, 2025 14:28 — with GitHub Actions Error
@bentorb bentorb had a problem deploying to deployment-integ-test October 9, 2025 15:26 — with GitHub Actions Error
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

2 participants