AWS CLI 2 cheatsheet
AWS CLI 2: Setup and credentials
8 common AWS CLI 2 tasks.
Configure credentials
Set your access key, secret key, default region and output format interactively.
aws configure
Configure a named profile
Store a second set of settings under a profile name.
aws configure --profile dev
Set up IAM Identity Center
Create a profile that signs in with single sign-on instead of long-lived keys.
aws configure sso
Check who you are
Show the account and identity the CLI is using. The first thing to check when something is denied.
aws sts get-caller-identity
Use a profile for the session
Make every command in this shell use a profile.
export AWS_PROFILE=dev