Terraform for AWS Installation and Configuration AWS CLI

Paul Ravvich
Tarraform using Amazon Web Services
2 min readMay 11, 2024
Terraform for GCP Installation AWS CLI

Hi, this is Paul, and welcome to the #2 part of my Terraform guide. Today we will discuss how to install AWS CLI.

Create Secret Keys

  1. Go to Amazon Web Services web console and find IAM Service
  2. On IAM Service homepage click on Users:
  3. Go inside the user we want to use for Terraform (Click on the username in the user table)
  4. Go to the Security credentials tab
  5. Click Create access key

You see you're secret not close to this window for a while.

Installation AWS CLI

MacOS

$ curl "https://awscli.amazonaws.com/AWSCLIV2-2.0.30.pkg" -o "AWSCLIV2.pkg"
$ sudo installer -pkg AWSCLIV2.pkg -target /

And after $ which aws command you see the output /usr/local/bin/aws

And after aws --version the output like: aws-cli/2.0.30 Python/3.7.4 Darwin/23.4.0 botocore/2.0.0dev34

Configuration

In terminal and type $ aws configure

Here you need to set secrets for access to AWS through the CLI

AWS Access Key ID [******]: paste Access key ID from aws console (step 5)

AWS Secret Access Key [******]: paste Secret access key from aws console (step 5)

You can change the Default region and Output format if you need to.

If you need to look at the configuration you can use the command:

cat $HOME/.aws/credentials

Windows

Download MSI Installer https://awscli.amazonaws.com/AWSCLIV2-2.0.30.msi

And after aws --version the output like: aws-cli/2.0.30 Python/3.7.4 Windows/10 exe/AMD 64 prompt/off

$ aws configure

Here you need to set secrets for access to AWS through the CLI

AWS Access Key ID [******]: paste Access key ID from aws console (step 5)

AWS Secret Access Key [******]: paste Secret access key from aws console (step 5)

You can change the Default region and Output format if you need to.

Linux

Installation depends on you're Linux version you can use the corresponding command from here

And $ aws configure work in the same way as for MacOS and Windows.

Thank you for reading until the end. Before you go:

Paul Ravvich

--

--

Paul Ravvich
Tarraform using Amazon Web Services

Software Engineer with over 10 years of XP. Join me for tips on Programming, System Design, and productivity in tech! New articles every Tuesday and Thursday!