AWS CLI
Explain how to use the AWS Command Line Interface (CLI) to interact with AWS services.
Installation
see https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Configuration
Depending on the file, profile section names use the following format:
Config file: [default] [profile user1]
Credentials file: [default] [user1]
Do not use the word profile when creating an entry in the credentials file.
The following examples show a credentials and config file with two profiles, region, and output specified. The first [default] is used when you run a AWS CLI command with no profile specified. The second is used when you run a AWS CLI command with the --profile
user1 parameter.
~/.aws/credentials
1 | [default] |
~/.aws/config
1 | [default] |
Using the AWS CLI
Command Structure
1 | aws <command> <subcommand> [options and parameters] |
Basic Usage
1 | aws s3 ls --profile dev |
Auto Prompt mode
1 | aws --cli-auto-prompt |