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 configure sso
    Code Block
    languagebash
    aws s3 ls --profile profile1
  • Environment Variables

    Code Block
    languagebash
    export AWS_ACCESS_KEY_ID=<AccessKeyId>
    export AWS_SECRET_ACCESS_KEY=<SecretAccessKey>
    export AWS_SESSION_TOKEN=<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

...