RoleMappings with IdentityPoolRoleAttachment resource issue (can't use Join)
See original GitHub issueclass IdentityPoolRoleAttachment(AWSObject):
resource_type = "AWS::Cognito::IdentityPoolRoleAttachment"
props = {
'IdentityPoolId': (basestring, True),
'RoleMappings': (dict, False),
'Roles': (dict, False),
}
On the RoleMappings prop of the IdentityPoolRoleAttachment resource, there is a mismatch with the official configuration :
RoleMappings How users for a specific identity provider are to mapped to roles. This is a string to RoleMapping object map. The string identifies the identity provider, for example, “graph.facebook.com” or “cognito-idp-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id”
To build the provider name string of the cognito user pool with the client id, it’s necessary to Join multiple values like this :
Join(":", [GetAtt(cognito_user_pool, "ProviderName"),GetAtt(cognito_user_pool_app_client, "Name")])
But if I put the Join value as a key of the RoleMappings dict, I have the following error:
TypeError: key <troposphere.Join object at 0x1020bb0d0> is not a string
Is it a CloudFormation limitation or Troposphere limitation? Thanks !
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Just stumbled upon this github discussion, I’m not using troposphere myself, but run into the same issue with cognito a few months ago. see the discussion at https://forums.aws.amazon.com/message.jspa?messageID=790437#790437 - it’s a cloudformation design flaw. We wrote a custom resource backed by a lambda function (see aws forum link) to work around the issue.
thx @michaellieberherr a long time after, here is my final integration with troposphere example: