簡體   English   中英

如何在Cloudformation模板參數中創建IAM角色下拉列表

[英]How can I create IAM Role Dropdown in Cloudformation Template Parameters

我正在尋找一種方法來列出Cloudformation模板中現有的IAM角色,其方式與列出EC2密鑰對相似。 下面是我正在嘗試使用EC2密鑰對和IAM角色的示例,但是Cloudformation會拋出錯誤,指出“RoleName”不存在。

"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"
},

Cloudformation Interface的屏幕截圖如果有可能實現這個想法嗎?

下拉列表中並不支持所有類型,並且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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM