我想使用cloudformation映射为我的lambda函数设置环境变量。因此,我正在使用0
从映射中获取变量的值。但是我遇到了错误-Fn::FindInMap
Value of property Variables must be an object with String (or simple type) properties
答案 0 :(得分:1)
您正在将DUB_CROSS_ACCOUNT_IAM_ROLE
设置为数组。试试
Environment:
Variables:
DUB_CROSS_ACCOUNT_IAM_ROLE:
Fn::FindInMap:
- DomainResourceMapping
- DUBCrossAccountIAMRole
- {Ref: Stage}
或使用简短语法
Environment:
Variables:
DUB_CROSS_ACCOUNT_IAM_ROLE: !FindInMap [ DomainResourceMapping, DUBCrossAccountIAMRole, !Ref Stage