-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(s3): cannot deploy multiple replication source buckets (under feature flag) #33360
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33360 +/- ##
=======================================
Coverage 82.21% 82.21%
=======================================
Files 119 119
Lines 6876 6876
Branches 1162 1162
=======================================
Hits 5653 5653
Misses 1120 1120
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more.
|
How does this work in a scenario where multiple stages are deployed to 1 account? So we have 2 buckets from the TEST stage being replicated and 2 buckets from the PRD stage being replicated? Will they use the same role? And what if the replication is cross-account? I was more thinking along the lines of adding an optional BTW, https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L2853 appears to be confusing the buckets: |
@jochemd
One replication role is generated for each source bucket, regardless of stage differences or whether cross-account access is involved.
Since one replication role executes replication according to multiple replication rules, it seems difficult to simply add a
Oh! I've not realized this. I'll resolve this problem in another PR. |
@jochemd From my perspective, since the current implementation is problematic, I think it would be best to first merge this PR to remove the hardcoded role name, and then create a new PR as a new feature to accept an optional replication role. |
Sounds good to me. Unfortunately I am not able to give an actual review or serious testing of this PR as when I try to go through the steps in the contributing guide I get errors on the linking step. |
### Issue # (if applicable) None ### Reason for this change As mentioned in [this comment](#33360 (comment)), the annotation phrase is incorrect and may confuse users. The `addReplicationPolicy()` function works to add a resource policy for the destination bucket, but the annotation phrase says source bucket. ### Description of changes ```diff - For Cross-account S3 replication, ensure to set up permissions on source bucket using method addReplicationPolicy() + For Cross-account S3 replication, ensure to set up permissions on destination bucket using method addReplicationPolicy() ``` ### Describe any new or updated permissions being added None ### Description of how you validated changes None ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
) ### Issue # (if applicable) None ### Reason for this change As mentioned in [this comment](aws#33360 (comment)), the annotation phrase is incorrect and may confuse users. The `addReplicationPolicy()` function works to add a resource policy for the destination bucket, but the annotation phrase says source bucket. ### Description of changes ```diff - For Cross-account S3 replication, ensure to set up permissions on source bucket using method addReplicationPolicy() + For Cross-account S3 replication, ensure to set up permissions on destination bucket using method addReplicationPolicy() ``` ### Describe any new or updated permissions being added None ### Description of how you validated changes None ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit comment. The changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you as always for contributing!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@GavinZZ Thank you always too! |
Guys is it weird the PR stuck too long while being the 1st in queue ? |
@mergify update |
☑️ Nothing to do
|
@mergify dequeue |
❌ Command disallowed due to command restrictions in the Mergify configuration.
|
@GavinZZ Could you please resolve this mergify problem?? |
This pull request has been removed from the queue for the following reason: Pull request #33360 has been dequeued. Mergify failed to merge the pull request. GitHub can't merge the pull request after 15 retries. You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@mergify requeue |
❌ Command disallowed due to command restrictions in the Mergify configuration.
|
@mergify update |
❌ Base branch update has failedexpected head sha didn’t match current head ref. |
@badmintoncryer somehow I can't update latest main branch to this PR.. The PR seems to stuck at |
Comments on closed issues and PRs are hard for our team to see. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Closes #33355.
Reason for this change
We cannot deploy multiple source buckets for object replication due to the explicitly set replication role name.
Description of changes
Set replication role name by
PhysicalName.GENERATE_IF_NEEDED
.Describe any new or updated permissions being added
None
Description of how you validated changes
Update both unit and integ test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license