To set up user access

  • Create a named profile: aws configure --profile <profile-name> (e.g. iamadmin-general)
  • To use a named profile: aws s3 ls --profile <profile-name>
  • To set default profile: export AWS_DEFAULT_PROFILE=<profile-name>

Avoid using IAM user for local development

Instead of using long-term IAM users for AWS CLI in development, considering using AWS Identity Center and SSO session (create user in IAM Identity Center, set up SSO user with aws configure sso, and use aws sso login --profile <profile-name> when session expires).