我正在寻找一种方法来列出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"
},
Run Code Online (Sandbox Code Playgroud)
Cloudformation Interface的屏幕截图 如果有可能实现这个想法吗?