【发布时间】:2018-01-24 04:27:22
【问题描述】:
我有一个如下所示的映射:
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 不高兴,因为它不包含字母数字字符
【问题讨论】:
-
你没有a映射。您在该 YAML 文档中有四 (4) 个映射。
标签: amazon-web-services yaml amazon-cloudformation