AWS CLI IAM and STS Cheat Sheet/Update a role trust policy

Replace the trust policy on an existing role.

Section: Roles, Trust, and Access Keys

Update a role trust policy

bash
bash
aws iam update-assume-role-policy --role-name AppRole --policy-document file://trust-policy.json
Explanation

Useful when adding or tightening OIDC and cross-account trust.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Roles, Trust, and Access Keys
Create a role
Create a role with a trust policy.
OpenIn sheetbashsame section
List roles
Show IAM roles in the account.
OpenIn sheetbashsame section
Create an access key
Generate a long-term access key for an IAM user.
OpenIn sheetbashsame section
List access keys for a user
Inspect active access keys for an IAM user.
OpenIn sheetbashsame section
Disable an access key
Change an access key status.
OpenIn sheetbashsame section
Delete an access key
Remove an old access key from an IAM user.
OpenIn sheetbashsame section