Wednesday, September 4, 2024

How to Install AWS CLI Tool on Ubuntu 24.04 LTS

The AWS Command Line Interface (CLI) is a powerful tool that empowers developers, system administrators, and DevOps professionals to interact with Amazon Web Services (AWS) resources from the comfort of their terminal. With its ability to manage multiple AWS services, automate tasks through scripts, and support all AWS services, the AWS CLI simplifies cloud infrastructure management and streamlines workflows. This comprehensive guide will walk you through the process of installing the AWS CLI on Ubuntu 24.04, empowering you to take control of your AWS environment.

Setting the Stage: Preparing Your System for AWS CLI Installation

Before embarking on the installation journey, it's essential to ensure your Ubuntu 24.04 system is ready to welcome the AWS CLI. This involves updating your package list and installing necessary dependencies.

1. Refreshing Your Package List:

Begin by updating your system's package list to access the latest information on available packages and their dependencies. This ensures you're working with the most up-to-date software resources.

      sudo apt update
    

2. Installing Essential Dependencies:

The AWS CLI relies on Python and the unzip utility for smooth operation. These essential components need to be installed before proceeding.

      sudo apt install -y python3 python3-pip unzip
    
Downloading the AWS CLI: Acquiring the Installation Files

Now that your system is prepped, it's time to obtain the AWS CLI installation files. This is done directly from the official AWS website using the curl command.

3. Downloading the AWS CLI Installation File:

The following command downloads the latest version of the AWS CLI as a ZIP file to your home directory:

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

Extracting and Installing the AWS CLI: Unpacking the Power

With the installation files safely downloaded, it's time to extract them and install the AWS CLI on your system.

4. Extracting the ZIP File:

Use the unzip command to extract the contents of the downloaded ZIP file into a directory named "aws":

      unzip awscliv2.zip
    
5. Installing the AWS CLI:

Navigate to the extracted directory and run the install script to complete the installation process:

      sudo ./aws/install
    

Verification: Ensuring a Successful Installation

To confirm that the AWS CLI has been successfully installed, run the following command to check its version:

6. Verifying the Installation:

      aws --version
    
You should see output similar to:
      aws-cli/2.x.x Python/3.x.x Linux/4.x.x-xx-generic exe/x86_64.ubuntu.24.04
    
This indicates that the AWS CLI version 2.x.x is successfully installed on your system.

Configuring the AWS CLI: Granting Access to Your AWS Resources

The AWS CLI requires your AWS credentials and preferred settings to interact with your AWS resources. The configuration process is straightforward and involves providing essential details.

7. Configuring the AWS CLI:

Run the following command to initiate the configuration process:

      aws configure
    
You'll be prompted to enter the following information:
  • AWS Access Key ID: Your unique AWS Access Key ID.

  • AWS Secret Access Key: Your corresponding AWS Secret Access Key.

  • Default region name: The AWS region you frequently use (e.g., us-west-2).

  • Default output format: The output format you prefer (e.g., json, text, or yaml). JSON is commonly used for its structured data representation.

Cleaning Up: Tidy Installation for a Streamlined Environment

Once the installation and configuration are complete, you can remove the temporary files to free up disk space.

8. Cleaning Up Installation Files (Optional):

      rm -rf awscliv2.zip aws
    

Conclusion: Embracing the Power of the AWS CLI

Congratulations! You have successfully installed the AWS CLI on Ubuntu 24.04 and are now ready to leverage its powerful capabilities to manage your AWS resources from the command line. The AWS CLI documentation provides comprehensive information on available commands, usage examples, and advanced features.

This guide has empowered you with the knowledge to install and configure the AWS CLI, unlocking a world of possibilities for managing your AWS infrastructure efficiently and effectively. Embrace the power of the AWS CLI and elevate your cloud management experience to new heights.

0 comments:

Post a Comment