AWS Command Line Interface (AWS CLI) is in two versions. To ensure the practicality of this lab, you will only practice installing AWS CLI v2 for Windows and Ubuntu because it is simpler, more convenient, and more complete than AWS CLI v1.
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
sudo ln -s /folder/installed/aws-cli/aws /usr/local/bin/aws
sudo ln -s /folder/installed/aws-cli/aws_completer /usr/local/bin/aws_completer
aws --version
We will use the AWS configure command. This is considered the fastest way to set up the AWS CLI. The command window will appear asking for four information as follows:
aws configure
AWS Access Key ID [None]: *AKIAIOSFODNN7EXAMPLE*
AWS Secret Access Key [None]: *wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY*
Default region name [None]: *ap-southeast-1*
Default output format [None]: *json*
The AWS CLI stores this set of information in a profile (set of settings) named default in the credentials. By default, the information in this configuration is used by the AWS CLI when you run the aws configure command without explicitly specifying a profile.
aws configure --profile devops
The access key includes the access key ID and secret access key, which is used to sign application requests that you send to AWS.
cd ~/.aws/
ls
cat config
aws configure get region --profile devops
aws configure list
aws configure list-profiles
You can add or edit profiles directly by editing the two files config and credentials with your operating system’s editor.