amazon-web-services - CloudFormation AWS::Cognito::IdentityPoolRoleAttachment RoleMappings 语法错误
问题描述
在我的 AWS CloudFormation 堆栈中,我想将角色附加到 Cognito 身份池(有效),对于身份验证提供程序 > Cognito > 已验证角色选择,使用 CloudFormation 语法选择“从令牌中选择角色”(无效),如下:
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
部署时,出现以下错误:
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}].
但据我了解AWS CloudFormation 文档,我认为我使用了正确的语法。
我该如何解决?
谢谢你的帮助。
解决方案
我认为你应该关注AWS::Cognito::IdentityPoolRoleAttachment
但不是的语法RoleMappings
。
从AWS::Cognito::IdentityPoolRoleAttachment,我们可以进入RoleMappings
这是 RoleMapping 对象映射的字符串
所以我觉得你可以试试:
RoleMappings:
'graph.facebook.com':
Type: Token
AmbiguousRoleResolution: AuthenticatedRole
这里'graph.facebook.com'
只是一个例子。
推荐阅读
- visual-studio-code - 如何更改vscode中集成终端的标题?
- typescript - 转换到/从 json 时,是否可以让类转换器使用 getter/setter
- javascript - 在打字稿中编写 if..else 块的更好方法,中间有网络调用
- cookies - httponly cookie 未设置
- android - 带有 MediaProjection 屏幕捕获的 AudioPlaybackCapture android 10 不起作用
- reactjs - fetchMore 导致页面意外重新渲染
- javascript - firebase 功能内部服务器和最大 sta
- joi - 使用 joi 进行条件验证
- postgresql - MS Access + Postgres 口音/不区分大小写的可编辑过滤器
- node.js - 登录到 Nodejs 日志中间件中的 AWS CloudWatch Logs(例如:morgan、pino)