-
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
aws-cognito-identitypool-alpha: Can't add rules for the default authenticated role #27411
Comments
Thanks for the detailed description of this issue, and for posting a workaround. I was curious to look into this further because i'm honestly not familiar with cognito personally, and I'm getting a different error when using this code snippet: const identityPool = new IdentityPool(stack, 'identity-pool', {
allowUnauthenticatedIdentities: false,
authenticationProviders: {
google: {
clientId: '12345678012.apps.googleusercontent.com',
},
},
})
identityPool.addRoleMappings({
providerUrl: IdentityPoolProviderUrl.GOOGLE,
rules: [
{
claim: 'sub',
claimValue: '12345678012',
mappedRole: identityPool.authenticatedRole,
},
],
})
Could you help me understand why the cloudformation template generated by this snippet is failing in the first place? |
Hi Peter Thanks for looking into this. I get the same error message, which I should have probably posted in the first place. In fact, if you look at your CloudFormation console, you should see two error messages. First, the one you posted, with the Logical ID of
Note I think the reason we see the From the
And the second error, which I originally posted, with the Logical ID of
I believe the I don't know enough about |
I've found that the issue seems to be stemming from the way the service API is creating the ID for the |
Since the root cause of this issue seems to be the same as #23449, I will close this one in favour of tracking there. If this problem persists after the other issue has been resolved, please feel free to open a new issue. |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
I am trying to configure an
IdentityPool
withgoogle
as anauthenticationProviders
and add some customrules
throughroleMappings
.It's neither possible directly through the initiation of the
IdentityPool
, nor later through theaddRoleMappings()
method.Expected Behavior
To be able to add custom
rules
to the default roles during initiation of theIdentityPool
, or add them later with theaddRoleMappings()
methodCurrent Behavior
Getting errors that the
DefaultRoleAttachment
failed to update, so can't create a new oneReproduction Steps
Since this isn't possible
I instead tried this
Possible Solution
I don't have a technical solution to solve this, but I managed to get it working in a not so pretty way
This approach works, but it's not very intuitive and it does have two undesirable outcomes
adminRole
) when we could have just used the defaultAuthenticatedRole
Additional Information/Context
No response
CDK CLI Version
2.99.1
Framework Version
No response
Node.js Version
v20.8.0
OS
MacOS Ventura 13.5.2
Language
Typescript
Language Version
5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: