Terraform for AWS Installation and Configuration 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
- Go to Amazon Web Services web console and find
IAM
Service - On
IAM
Service homepage click onUsers:
- Go inside the user we want to use for Terraform (Click on the username in the user table)
- Go to the
Security credentials
tab - 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:
- Please consider clapping and following the writer! 👏
- Follow us on Twitter(X), LinkedIn