重命名 IAM 角色

Rename an IAM Role

我在创建 IAM 角色以允许 lambda 函数访问 cloudwatch 日志并创建 EC2 卷快照时输入错误。有什么方法可以重命名角色,是使用控制台还是 AWS CLI?

创建角色后,您无法编辑 IAM 角色。这在多处都有提及,包括通过 IAM 控制台创建角色时。

并且在 docs 的几个地方。

For Role name, type a role name to help identify the purpose of this role. Role names must be unique within your AWS account. After you enter the name, click Next Step.

Role names have character limitations. The number of roles in an AWS account and the policy size for policies attached to roles are also limited. For more information, see Limitations on IAM Entities and Objects. Note that you cannot edit the name of the role after it is created.

无法通过控制台或 AWS CLI 编辑名称。