设置 IAM 角色描述
Set IAM Role Description
在 AWS 控制台中,有一个选项可以设置 IAM 角色的描述。您如何使用 CloudFormation 做到这一点?该文档没有说明如何执行此操作。到目前为止我已经尝试过了。
Resources:
MyRole:
Type: "AWS::IAM::Role"
Properties:
Description: My Description
产生的错误:没有实际的 CF 错误,但此描述未显示在控制台中
Resources:
MyRole:
Type: "AWS::IAM::Role"
Description: My Description
Properties:
.....
产生的错误:"Encountered unsupported property Description"
Resources:
MyRole:
Type: "AWS::IAM::Role"
Properties:
Tags:
Key: Description
Value: My Description
产生的错误:"Encountered unsupported property Tags"
Resources:
MyRole:
Type: "AWS::IAM::Role"
Tags:
Key: Description
Value: My Description
Properties:
.....
产生的错误:"Encountered unsupported property Tags"
2019 年 11 月更新:
CloudFormation 现在支持 Description
字段。
Properties:
AssumeRolePolicyDocument: Json
Description: String <--- Here
ManagedPolicyArns:
- String
MaxSessionDuration: Integer
Path: String
PermissionsBoundary: String
Policies:
- Policy
RoleName: String
Tags:
- Tag
经过测试,可以确认 John Rotenstein 的答案截至 29/Mar/2019 仍然是最佳选择。有时更新可能会在不制作文档的情况下潜入,但不幸的是在这种情况下不会。
(本希望将此作为评论,但声誉要求很痛苦)
编辑:
July/2019 - 仍然没有更新,但是这可以通过 SDK 完成
它似乎已于 2019 年 9 月 3 日添加。查看 AWS CloudFormation 文档的 this 部分。
在 AWS 控制台中,有一个选项可以设置 IAM 角色的描述。您如何使用 CloudFormation 做到这一点?该文档没有说明如何执行此操作。到目前为止我已经尝试过了。
Resources:
MyRole:
Type: "AWS::IAM::Role"
Properties:
Description: My Description
产生的错误:没有实际的 CF 错误,但此描述未显示在控制台中
Resources:
MyRole:
Type: "AWS::IAM::Role"
Description: My Description
Properties:
.....
产生的错误:"Encountered unsupported property Description"
Resources:
MyRole:
Type: "AWS::IAM::Role"
Properties:
Tags:
Key: Description
Value: My Description
产生的错误:"Encountered unsupported property Tags"
Resources:
MyRole:
Type: "AWS::IAM::Role"
Tags:
Key: Description
Value: My Description
Properties:
.....
产生的错误:"Encountered unsupported property Tags"
2019 年 11 月更新:
CloudFormation 现在支持 Description
字段。
Properties:
AssumeRolePolicyDocument: Json
Description: String <--- Here
ManagedPolicyArns:
- String
MaxSessionDuration: Integer
Path: String
PermissionsBoundary: String
Policies:
- Policy
RoleName: String
Tags:
- Tag
经过测试,可以确认 John Rotenstein 的答案截至 29/Mar/2019 仍然是最佳选择。有时更新可能会在不制作文档的情况下潜入,但不幸的是在这种情况下不会。
(本希望将此作为评论,但声誉要求很痛苦)
编辑: July/2019 - 仍然没有更新,但是这可以通过 SDK 完成
它似乎已于 2019 年 9 月 3 日添加。查看 AWS CloudFormation 文档的 this 部分。