2017-08-12 38 views
0

我正在寻找一种方式,列出在Cloudformation模板的现有IAM角色以类似的方式,以上市说EC2密钥对。下面是什么,我既EC2密钥对和IAM角色试图然而Cloudformation抛出一个错误,指出“角色名”不存在的例子。我怎样才能创建Cloudformation模板参数IAM角色下拉

"KeyName": { 
    "Description" : "Choose a Key Pair that is available in this region", 
    "Type": "AWS::EC2::KeyPair::KeyName", 
    "ConstraintDescription": "Must be the name of an existing EC2 Key Pair" 
}, 
"ServiceRole": { 
    "Description" : "Choose an IAM Role that is available in this region", 
    "Type": "AWS::IAM::Role::RoleName", 
    "ConstraintDescription": "Must be the name of an existing IAM Role" 
}, 

Screenshot of Cloudformation Interface 任何想法,如果这是可能实现的?

回答

3

并非所有类型在下拉列表的支持,IAM角色是不支持的类型。所以你无法获得IAM角色的下拉菜单。相反,你将不得不使用一个简单的文本框。

这里是一个支持的参数类型的当前列表:

  • String
  • Number
  • List<Number>
  • CommaDelimitedList
  • AWS::EC2::AvailabilityZone::Name
  • AWS::EC2::Image::Id
  • AWS::EC2::Instance::Id
  • AWS::EC2::KeyPair::KeyName
  • AWS::EC2::SecurityGroup::GroupName
  • AWS::EC2::SecurityGroup::Id
  • AWS::EC2::Subnet::Id
  • AWS::EC2::Volume::Id
  • AWS::EC2::VPC::Id
  • AWS::Route53::HostedZone::Id
  • List<AWS::EC2::AvailabilityZone::Name>
  • List<AWS::EC2::Image::Id>
  • List<AWS::EC2::Instance::Id>
  • List<AWS::EC2::SecurityGroup::GroupName>
  • List<AWS::EC2::SecurityGroup::Id>
  • List<AWS::EC2::Subnet::Id>
  • List<AWS::EC2::Volume::Id>
  • List<AWS::EC2::VPC::Id>
  • List<AWS::Route53::HostedZone::Id>

来源:http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html

+0

太好了!感谢您的联系和详细的解答@马特 - 豪泽 –

相关问题