我有一个类似这样的映射:
Mappings:
AccountToParams:
aws-1234567890:
sshSecurityGroup: sg-abcedf12
我希望能够通过AccountId来检索我的变量,但是这一步卡在了“验证”环节。
SecurityGroups:
- !FindInMap [AccountToParams, !Sub "aws-${AWS::AccountId}", sshSecurityGroup]
错误是指
16/08/2017, 16:36:18 - Template contains errors.: Template error:
every Fn::FindInMap object requires three parameters,
the map name, map key and the attribute for return value
目标是使某些配置由账户(因此是环境)驱动。但我似乎不能使用accountId作为映射中的键,否则AWS不会满意,因为它不包含字母数字字符。