-
Notifications
You must be signed in to change notification settings - Fork 4k
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(cognito-identitypool-alpha): remove RoleAttachment
construct
#33305
base: main
Are you sure you want to change the base?
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
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.
packages/@aws-cdk/aws-cognito-identitypool-alpha/lib/identitypool.ts
Outdated
Show resolved
Hide resolved
/** | ||
* 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 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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
IdentityPool
can only have a singleIdentityPoolRoleAttachment
attached 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:IdentityPoolRoleAttachment
classIdentityPoolRoleAttachment.configureRoleMappings()
function has been moved inside ofIdentityPool
IIdentityPoolRoleAttachment
andIdentityPoolRoleAttachmentProps
interfacesIdentityPoolRoleMapping
,RoleMatchingMatchType
, andRoleMappingRule
tolib/identitypool.ts
IdentityPool
'sprivate roleAttachmentCount
attribute has been removed, as it never should have been there to begin withIdentityPool.addRoleMappings()
method has been removedIdentityPool
construct.Describe any new or updated permissions being added
N/A
Description of how you validated changes
yarn test
runs and the integ test snapshot was updated viayarn integ
.Checklist
BREAKING CHANGE: The
IdentityPoolRoleAttachment
construct andIdentityPool.addRoleMappings()
function will no longer exist. This is to disambiguate that only one role attachment can exist per Identity Pool. If you need to add role mappings, please do so when theIdentityPool
is created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license