- Newest
- Most votes
- Most comments
In a single-account configuration, you can still set up a role to be assumable by a user by directly modifying the trust relationship policy of the IAM role. Here's how you can do it This is also a useful guide :- https://docs.aws.amazon.com/singlesignon/latest/userguide/get-set-up-for-idc.html Create the IAM Role: Go to the IAM console: https://console.aws.amazon.com/iam/ Click on "Roles" in the left navigation pane. Click on "Create role". Choose the trusted entity type as "Another AWS account" (since you want the user in the same account to assume this role). Enter your account ID in the "Account ID" field. Attach policies to the role as necessary. Click on "Next: Tags" and "Next: Review". Enter a name for the role and optionally a description, then click "Create role". Modify the Trust Relationship:
After creating the role, select the role from the list in the IAM console. Click on the "Trust relationships" tab. Click on "Edit trust relationship". Modify the trust relationship policy document to allow the specific user to assume the role. Here's an example policy document:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<YOUR_ACCOUNT_ID>:user/<YOUR_USER_NAME>"
},
"Action": "sts:AssumeRole"
}
]
}
Replace <YOUR_ACCOUNT_ID> with your AWS account ID and <YOUR_USER_NAME> with the username of the IAM user you want to grant access to. Save the Trust Relationship:
After modifying the policy document, click on "Update Trust Policy" to save the changes. Once you have completed these steps, the IAM user specified in the trust relationship policy document will have permission to assume the IAM role. Ensure that the policies attached to the role grant the necessary permissions for the user's intended actions after assuming the role.
Hope it clarifies and if does I would appreciate answer to be accepted so that community can benefit for clarity, thanks ;)
Relevant content
asked 5 years ago
asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago

In my example I am using an Identity Center user and not an IAM user. Unfortunately this solution did not work for an Identity Center type user.