我有这个角色附件资源,按原样部署就好了:
db2RunSql()
但是,正如您所看到的,我有一个RoleMappings属性,实际上我的CognitoUserPool ProviderName附加到我的Cognito用户池客户端ID,因此我需要此属性具有动态名称。
然而,查看文档,我找不到在对象键上实际使用内部函数的方法。当我尝试这个时:
CognitoIdentityPoolRoleAttachment:
DependsOn: [ CognitoIdentityPool, CognitoIdentityPoolAuthRole, CognitoIdentityPoolUnauthRole ]
Type: "AWS::Cognito::IdentityPoolRoleAttachment"
Properties:
IdentityPoolId: !Ref CognitoIdentityPool
RoleMappings:
'cognito-idp.us-west-2.amazonaws.com/us-west-2_naEXQTLxD:44rd7mu8dncna2kqimd74f7u98':
Type: Token
AmbiguousRoleResolution: AuthenticatedRole
Roles:
unauthenticated: !GetAtt CognitoIdentityPoolUnauthRole.Arn
authenticated: !GetAtt CognitoIdentityPoolAuthRole.Arn
我收到了无效的模板错误。我是否缺少一种特殊的语法,允许您定义键而不是属性?或者我将不得不以其他方式这样做?