The fast and easy way to get started with Amazon Web Services (AWS) is using the AWS web console, often referred to as the “User Interface” or “UI” – or sometimes known as the “Graphical User Interface” or GUI – pronounced “gooey”. There are two other equally powerful ways to access AWS resources, using the AWS Command Line Interface (aws-cli) and using a progamming language-specific Software Development Kit (SDK). An SDK is generally used when invoking AWS resources within an application. On the other hand, the aws-cli enables the user to invoke AWS resources directly from his/her laptop.

We will install the aws-cli in five steps:

  1. Create a new user
  2. Create Key Secret
  3. Download CLI
  4. Configure Local
  5. Test Connectivity

STEP 1: Create a new user.

If you have not created a non-root user, create a new user in the AWS console. See this post for details.

STEP 2: Create a Key-Secret Pair.

  • Search for IAM in the console. Select IAM.
  • Select ‘Users’
  • Select the user created in Step 1
  • Select ‘Create access key’
  • Select “Command Line Interface (CLI)”

Scroll Down here and there is a not from AWS about recommended alternatives.

A Note here, I prefer to use VS code as my IDE rather than CloudShell, because it is closer to my source code for projects. For larger projects IAM Identiy Center can manage CLI access with tokens. For quickstart projects, downloading the key/secret pair is an acceptable risk. It’s ok to click the confirmation and proceed. The next tab, adding tags can be ignored. In the final step, download the .csv file to your machine.

Step 3: Download CLI

Use these commands for Linux x86. For other platforms see documentation.

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Step 4: Configure Local

For mac linux you can add your downloaded key/secret pair to your AWS credentials file located at ~/.aws/credentials

[default]
aws_access_key_id=<your key here>
aws_secret_access_key=<your secret here>

Note: if you have more than one account – you should use AWS Identity Center for authentication to avoid confusion.

STEP 5: Test Connectivity

Running the command aws s3 ls from your terminal should list the s3 buckets in your account. You’ve enter the powerful world of the AWS Command Line Interface. See reference guide for a full list of available commands.

You are officially ready to rock with the aws-cli. 🤘🏽 🎸

Categories: AWSINITIALIZE

Andrew Dunn

A Real Cool Dude

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *