Using AWS CLI for managing AWS Resources
Installing AWS CLI
- Login to the machine using privileged account.
- Download the latest build of AWS CLI.
- Windows download instruction and location:
- Linux download instruction and location:
How to configure AWS Account and Access Keys
- Login to the IAM Console:
- From the left pane, click on Users -> click on “Add user” -> specify the user name -> access type: “Programmatic access” -> do not select “AWS Management Console access” -> click “Next: Permissions”
- From the “add user to group”, either select existing group or click on “Create group” -> click “Next: Review” -> click on “Create user”
- Download the CSV file with the “Access key ID” and “Secret access key” and save the CSV file in a secure location
- Click Close
Configuring the AWS CLI
- Run the command below in-order to configure AWS CLI:
- aws configure –profile <profile_name>
- Profile name – set relevant target profile name
- AWS Access Key ID - Specify the value from the CSV of the previously created IAM user
- AWS Secret Access Key - Specify the value from the CSV of the previously created IAM user
- Default region name - Specify a region such as eu-west-1
- Default output format - JSON
- Note 1: By default, the credentials file is stored here:
- On Windows: C:\Users\username.aws\credentials
- On Linux: ~/.aws/credentials
- Note 2: Reference about configuration and credential file settings can be found at:
- https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html