-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(cognito-identitypool-alpha): remove RoleAttachment construct
#33305
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
Conversation
This reverts commit ba97306.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33305 +/- ##
=======================================
Coverage 80.92% 80.92%
=======================================
Files 236 236
Lines 14256 14256
Branches 2491 2491
=======================================
Hits 11537 11537
Misses 2434 2434
Partials 285 285
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
It feels like there's a bunch of breaking changes here. They need to be called out in the PR description so that they show up in the changelog.
didn't see em, sorry. i think the comment should have a remediation step for users tho
RoleAttachment constructRoleAttachment construct
RoleAttachment constructRoleAttachment construct
paulhcsun
left a comment
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 logic for creating a default role attachment has been altered to create the L1 instead of the L2. This will trigger redeployments for all users of the IdentityPool construct.
Can you elaborate on this decision to replace the L2 with the L1?
Overall looks good, just a few clarifying questions.
| /** | ||
| * Configures role mappings for the Identity Pool Role Attachment | ||
| */ | ||
| private configureRoleMappings( |
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.
Is this method the exact same implementation as the old one or were there any modifications made?
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.
It's directly copy-pasted from the old IdentityPoolRoleAttachment class, so all the logic is preserved.
…ool.ts Co-authored-by: paulhcsun <[email protected]>
Previously, the "role attachment" that links authenticated and unauthenticated roles to the identity pool were their own construct. The L1s exist separately, but since only one role attachment can exist for a given identity pool, the L2 is effectively useless, since we already create one by default. The |
paulhcsun
left a comment
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.
Thanks for addressing the questions, the changes look good to me. I've approved and added the do-not-merge label for now. If replacing the L2 with the L1 will cause redeployments for anyone using this construct, this should also be called out in the BREAKING CHANGES section. You can remove the label after that's been addressed.
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 #23449
Reason for this change
What we had assumed was a bug from the service team had been investigated and revealed to be expected behaviour: an
IdentityPoolcan only have a singleIdentityPoolRoleAttachmentattached to it. This went against our initial assumptions that were supported by previously-written code, which was that multiple of these attachments could be created. As such, to ensure clarity and prevent ambiguity, this library will be updated to abstract away the role attachment, as one is already created by default.Description of changes
identitypool-role-attachment.ts, moving or deleting its contents:IdentityPoolRoleAttachmentclassIdentityPoolRoleAttachment.configureRoleMappings()function has been moved inside ofIdentityPoolIIdentityPoolRoleAttachmentandIdentityPoolRoleAttachmentPropsinterfacesIdentityPoolRoleMapping,RoleMatchingMatchType, andRoleMappingRuletolib/identitypool.tsIdentityPool'sprivate roleAttachmentCountattribute has been removed, as it never should have been there to begin withIdentityPool.addRoleMappings()method has been removedIdentityPoolconstruct.Describe any new or updated permissions being added
N/A
Description of how you validated changes
yarn testruns and the integ test snapshot was updated viayarn integ.Checklist
BREAKING CHANGE: The
IdentityPoolRoleAttachmentconstruct andIdentityPool.addRoleMappings()function will no longer exist. This is to disambiguate that only one role attachment can exist per Identity Pool. If you are using theIdentityPoolconstruct, this change will trigger a redeployment. If you need to add role mappings, please do so when theIdentityPoolis created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license