【发布时间】:2016-05-25 06:43:19
【问题描述】:
我使用 CloudFormation 模板将实例部署到环境中。我希望模板为实例选择默认 EC2 实例配置文件,类似于“arn:aws:iam::12345678910:role/EC2InstanceProfile-InstanceRole-14F2A0ATJNUO1”
我想为我拥有的每个 AWS 账户使用相同的模板。但是,问题在于每个帐户中的实例配置文件名称都不同。随机生成的后缀附加到名称(在此示例中为 14F2A0ATJNUO1)。如何解决此问题以使模板可在每个帐户中重复使用。如果可能,请提供代码。
"EC2InstanceProfile" : {
"Description" : "The default instance profile",
"Type": "String",
"ConstraintDescription" : "must be the name of an existing defualt EC2 instance profile."
},
"IamInstanceProfile": { "Ref": "EC2InstanceProfile" }
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-cloudformation