Using AWS CLI for managing AWS Resources

From PUBLIC-WIKI
Revision as of 11:54, 8 June 2020 by Eyales (talk | contribs) (Created page with "== Installing AWS CLI == * Login to the machine using privileged account. * Download the latest build of AWS CLI. :* Windows download instruction and location: :: https://docs...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installing AWS CLI

  • Login to the machine using privileged account.
  • Download the latest build of AWS CLI.
  • Windows download instruction and location:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html
  • Linux download instruction and location:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

How to configure AWS Account and Access Keys

  • Login to the IAM Console:
https://console.aws.amazon.com/iam/
  • 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
Full list: https://docs.aws.amazon.com/general/latest/gr/rande.html
  • 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