This guide provides instructions for installing the AWS CLI and Terraform on a Linux system.
Ensure you have the necessary tools installed:
curl
: For downloading files from the internet.unzip
: For extracting files.
To install these tools, run:
sudo apt update && sudo apt install -y curl unzip
To install Terraform, use the following commands:
-
Download the latest Terraform package:
curl -fsSL "https://releases.hashicorp.com/terraform/1.9.8/terraform_1.9.8_linux_amd64.zip" -o terraform.zip
-
Unzip the downloaded file:
unzip -o terraform.zip
-
Move the
terraform
binary to/usr/local/bin
for global access:sudo mv terraform /usr/local/bin/
-
Remove the downloaded zip file:
rm terraform.zip
-
Verify the installation:
terraform -v
To install the AWS CLI, use the following commands:
-
Download the AWS CLI installation package:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
-
Unzip the downloaded file:
unzip awscliv2.zip
-
Run the installer:
sudo ./aws/install
-
Verify the installation:
aws --version
-
Remove the installation files:
rm -rf awscliv2.zip aws
After installing the AWS CLI, configure it using the following command:
aws configure
This command will prompt you to enter your:
- AWS Access Key ID
- AWS Secret Access Key
- Default region name
- Default output format
Follow the prompts to complete the configuration.
You now have both the AWS CLI and Terraform installed and ready to use!