Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename an IAM Role

I made a typo while creating an IAM role to allow a lambda function to access the cloudwatch logs and to create EC2 volumes snapshots. Is there any way to rename the role, whether by using the console or the AWS CLI ?

like image 234
Souad Avatar asked Feb 27 '17 14:02

Souad


People also ask

Do IAM role names have to be unique?

Within your account, a friendly name for a user, user group, role, or policy must be unique.

Can I rename a AWS user?

You can change the name of an AWS account in the AWS Billing and Management console. Note: Only the AWS account root user can modify the AWS account name. For more information, see Tasks that require root user credentials. Sign in to the AWS account that you want to modify using your root user credentials.

Can you duplicate an IAM role?

One way to approach it is to duplicate the existing role along with all its policies, make the needed change on the new role and run your tests. There's no aws iam copy-role command though... So your only option is to duplicate the role and its associated policies manually or to script the process.


1 Answers

You cannot edit IAM roles after the role has been created. This is mentioned in several places, including when the role is created through the IAM console.

enter image description here

And in several places in the 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.

It is not possible to edit the name via the console or AWS CLI.

like image 70
Brett DeWoody Avatar answered Oct 11 '22 15:10

Brett DeWoody