Assign and remove access
Assign user or group access to an AWS account
You can assign a user or group access to an AWS account by creating an assignment between the user or group, the account, and the IAM role that the user or group can assume in the account. Thus, a single assignment is a triplet consisting of the user or group ID, the account ID, and the IAM role ARN.
If you want to perform bulk assignments such as assigning the same role to a number of users and groups, you must create each assignment individually. You can script this procedure using the account access API, and the AWS SDK/CLI.
Console
The console provides a few different ways to assign new access depending on whether you want to first identify the account, the user, or the group.
Note
The account access manager console provides a search capability for users, groups, and accounts. To identify the role you want to assign, you must find its name (or ARN) beforehand. The account access manager console cannot detect IAM roles in AWS accounts.
For all procedures in this section, sign in to the management account (or delegated admin account), select the Region where account access manager is enabled, and navigate to Account access manager in the IAM console.
AWS CLI
The following AWS CLI command can be used to create an account assignment for a user:
aws account-access create-entitlement \ --region <Region> \ --application-arn "<Account_access_manager_ARN>" \ --entitlement '{ "principalRole": { "principal": { "identityCenter": { "userId": "<Identity_Center_User_ID>" } }, "roleArn": "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>" } }'
The following AWS CLI command can be used to create an account assignment for a group:
aws account-access create-entitlement \ --region <Region> \ --application-arn "<Account_access_manager_ARN>" \ --entitlement '{ "principalRole": { "principal": { "identityCenter": { "groupId": "<IDC_GROUP_ID>" } }, "roleArn": "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>" } }'
Remove user or group access to an AWS account
You can find the assignment to remove in several ways.
Console
For all procedures in this section, sign in to the management account (or delegated admin account), select the Region where account access manager is enabled, and navigate to Account access manager in the IAM console.
AWS CLI
To remove access with the CLI, you first need to find the account assignment (entitlement) and then use its ID in the following command. You can see later in this topic how to search for account assignments for a specific account, user, group, or role. The CLI refers to assignments as entitlements.
aws account-access delete-entitlement \ --region <Region> \ --application-arn "<Account_access_manager_ARN>" \ --entitlement-id "<ENTITLEMENT_ID>"