Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleAWS Authentication and Credentials Setup Methods

You can set up credentials using various methods such as command-line options, environment variables, assume role, credentials files, configuration files, etc.

  • Command-line Options

    Code Block
    languagebash
    aws s3 ls --profile profile1
  • Environment Variables

    Code Block
    languagebash
    export AWS_ACCESS_KEY_ID="AWS_ACCESS_KEY_ID_XXX"<AccessKeyId>
    export AWS_SECRET_ACCESS_KEY="AWS_SECRET_ACCESS_KEY_XXX"<SecretAccessKey>
    export AWS_SESSION_TOKEN="AWS_SESSION_TOKEN_XXX"<SessionToken>
  • Assume role

    Code Block
    aws sts assume-role \
        --role-arn arn:aws:iam::123456789012:role/xaccounts3access \
        --role-session-name s3-access-example
  • Credentials and Configuration File:
    Update in ~/.aws/credentials and ~/.aws/config

    Code Block
    languagebash
    aws configure

...