【发布时间】:2019-12-29 02:10:05
【问题描述】:
我正在尝试获取 AWS CloudFormation 模板,以提供 IAM 角色的下拉列表作为 EC2 创建模板的一部分。我有这个为子网 ID、VPC 和安全组工作,但坚持让它为 IAM 角色工作。
在下面的代码 sn-p 中,我的模板提示从下拉列表中输入 VpcName,但在尝试为 InstanceProfile 生成列表时失败。我尝试了许多不同的组合,例如:
"Type" : "AWS::IAM::Role"
"Type" : "AWS::IAM::ROLE"
"Type" : "AWS::IAM::Role:Id"
"Type" : "AWS::IAM::ROLE:ID"
},
"InstanceProfile": {
"Description": "Select the role for this EC2 instance",
"Type" : "AWS::IAM::InstanceProfile"
},
"VpcName" : {
"Description" : "Select the VPC for this EC2 Instances",
"Type" : "AWS::EC2::VPC::Id"
},
【问题讨论】:
-
我认为您现在可以做的最好的事情是,假设您要使用 CloudFormation,动态生成 IAM 角色列表,然后以编程方式将它们作为 CommaDelimitedList 注入模板,然后使用模板。
标签: json amazon-web-services amazon-cloudformation