-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(kinesisfirehose): can't call grantPrincipal multiple times #34682
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(kinesisfirehose): can't call grantPrincipal multiple times #34682
Conversation
…on multiple grantPrincipal calls
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.
(This review is outdated)
Exemption Request We know at the unit test level whether this bug has been resolved |
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.
Left some minor comments
} | ||
// backwards compatibility | ||
return new iam.Role(this, 'Service Role', { | ||
// backwards compatibility - create role only once |
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.
The comment backwards compatibility
doesn't fully explain the purpose of this change. It's not just for backwards compatibility but also to fix a bug where multiple calls to grantPrincipal would create multiple roles with the same name. Improve the comment to better explain the purpose. Maybe something like:
Create the role only once to ensure multiple calls to grantPrincipal return the same role instance, while maintaining backwards compatibility
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
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.
LGTM
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #.
Reason for this change
DeliveryStream creates a new iam.Role every reference grantPrincipal, so we get the error
There is already a Construct with name 'Service Role' in DeliveryStream [Delivery Stream Multiple]
. This is easy to reproduce if you use deliveryStream with multiplegrantXXX
methods.This is test result before fix codes.
Description of changes
I changed grantPrincipal implementation from create a new iam.Role every reference to create a new iam.Role only at first reference.
Describe any new or updated permissions being added
None.
Description of how you validated changes
Create the new unit test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license