In my AWS CloudFormation stack, I want to attach roles to Cognito identity pool (which works), and for Authentication providers > Cognito > Authenticated role selection, select "Choose role from token" using the CloudFormation syntax (which doesn't work), as followed:
wzjCognitoIdentityPoolRoles:
Type: AWS::Cognito::IdentityPoolRoleAttachment
Properties:
IdentityPoolId:
Ref: wzjCognitoIdentityPool
Roles:
authenticated:
Fn::GetAtt: [cognitoAuthRoleWithIdentity, Arn]
unauthenticated:
Fn::GetAtt: [cognitoAuthRoleNoIdentity, Arn]
RoleMappings:
Type: Token
AmbiguousRoleResolution: AuthenticatedRole
When I deploy, I got the following error:
An error occurred: wzjCognitoIdentityPoolRoles - Property validation failure: [Value of property {/RoleMappings/Type} does not match type {Object}, Value of property {/RoleMappings/AmbiguousRoleResolution} does not match type {Object}].
But as I understand the AWS CloudFormation documentation, I think I use the correct syntax.
How can I fix that?
Thanks for your help.