Skip to content
Search

AWS Command Line Interface

lastmod 2023-02-10created 2023-02-088 edits

AWS Command Line Interface

Categories

Docker Image

docker run --rm -it amazon/aws-cli help

Environment variables

AWS_ACCESS_KEY_ID
Your Access key ID
AWS_SECRET_ACCESS_KEY
Your Secret access key
AWS_DEFAULT_REGION
Your region code

Basic configuration

aws configure

Example:

$ aws configure
AWS Access Key ID [None]: AKIAVB2U2RLDBY36QU2G
AWS Secret Access Key [None]: 6KlgHQm8CwSHnFpwNyYZkETU0AIU0Md2HXmMz3NK
Default region name [None]: ap-northeast-2
Default output format [None]: json

This saves a config file and a credentials file in the ~/.aws directory. Their contents are as follows.

$ cat ~/.aws/config
[default]
region = ap-northeast-2
output = json

$ cat ~/.aws/credentials
[default]
aws_access_key_id = AKIAVB2U2RLDBY36QU2G
aws_secret_access_key = 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

Checking the configuration

$ aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************QK2G              env
secret_key     ****************z3NK              env
    region           ap-northeast-2              env    ['AWS_REGION', 'AWS_DEFAULT_REGION']

See also

author Zer0 sitemap