Aws cli install on linux

Install the AWS CLI

You can install the latest version of the AWS CLI for macOS, Linux, or Windows.

Important

To set up Amazon EMR on EKS, you must have the latest version of AWS CLI installed.

To install or update the AWS CLI for macOS

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

If you’re unable to use the AWS CLI version 2, then ensure that you have the latest version of the AWS CLI version 1 installed using the following command.

pip3 install awscli --upgrade --user

To install or update the AWS CLI for Linux

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

If you’re unable to use the AWS CLI version 2, then ensure that you have the latest version of the AWS CLI version 1 installed using the following command.

pip3 install --upgrade --user awscli

To install or update the AWS CLI for Windows

  1. Download the AWS CLI MSI installer for Windows (64-bit) at https://awscli.amazonaws.com/AWSCLIV2.msi
  2. Run the downloaded MSI installer and follow the onscreen instructions. By default, the AWS CLI installs to C:\Program Files\Amazon\AWSCLIV2.

If you’re unable to use the AWS CLI version 2, then ensure that you have the latest version of the AWS CLI version 1 installed using the following command.

pip3 install --user --upgrade awscli

Configure your AWS CLI credentials

Both eksctl and the AWS CLI require that you have AWS credentials configured in your environment. The aws configure command is the fastest way to set up your AWS CLI installation for general use.

$ aws configure AWS Access Key ID [None]: AWS Secret Access Key [None]: Default region name [None]: Default output format [None]:

When you type this command, the AWS CLI prompts you for four pieces of information: Access key, secret access key, AWS Region, and output format. This information is stored in a profile (a collection of settings) named default . This profile is used when you run commands unless you specify another one. For more information, see Configuring the AWS CLI in the AWS Command Line Interface User Guide.

Читайте также:  Linux ubuntu add to path

Источник

Install AWS Command Line Interface (CLI) on Ubuntu 22.04 LTS

AWS CLI or Amazon Web Service Command Line Interface is a command-line tool for managing and administering your Amazon Web Services. AWS CLI provides direct access to the public API (Application Programming Interface) of Amazon Web Services. Since it’s a command-line tool, you can also use it to create scripts for automating your Amazon Web Services.

In this article, I will show you how to install the AWS CLI program on Ubuntu 22.04 LTS using the APT package manager. I will also show you how to install the latest version of the AWS CLI program on Ubuntu 22.04 LTS as a Python module using Python PIP. So, let’s get started.

Table of Contents

Installing AWS CLI Using APT Package Manager

AWS CLI is available in the official package repository of Ubuntu 22.04 LTS. So, it is very easy to install.

First, update the APT package repository cache with the following command:

The APT package repository cache should be updated.

To install AWS CLI on Ubuntu 22.04 LTS from the official package repository, run the following command:

Press Y and then press to confirm the installation.

The required packages are being downloaded from the internet. It will take a few seconds to complete.

Once the packages are downloaded, the APT package manager will install them. It will take a few seconds to complete.

AWS CLI should be installed at this point.

To check whether AWS CLI is working correctly with the following command:

As you can see, AWS CLI is working correctly.

Читайте также:  Запуск php сервера linux

Installing AWS CLI Using Python PIP

AWS CLI is also available as a Python module. The advantage of installing AWS CLI as a Python module is that you always get an up-to-date version of the AWS CLI program. If AWS CLI is installed as a Python module, it will be very easy to update AWS CLI once a new version of AWS CLI is available. You also don’t need superuser privileges to install AWS CLI as a Python module. AWS CLI can also be installed in a Python virtual environment.

AWS CLI is available for Python 2 and Python 3. You must have Python PIP installed on your computer for installing AWS CLI on Ubuntu 22.04 LTS as a Python module. Python PIP is not installed by default on Ubuntu 22.04 LTS. But you can install it easily from the official package repository of Ubuntu.

To install Python PIP on Ubuntu 22.04 LTS, run the following command:

For Python 2:

For Python 3:

Press Y and then press to confirm the installation.

Python PIP should be installed.

To install AWS CLI on Ubuntu 22.04 LTS as a Python module using Python PIP, run the following command:

Python 2 PIP:

Python 3 PIP:

AWS CLI is being installed as a Python module. It will take a few seconds to complete.

The latest version of AWS CLI should be installed as a Python module.

Once AWS CLI is installed as a Python module, you can run AWS CLI as follows:

Python 2 Command:

Python 3 Command:

As you can see, AWS CLI is working correctly.

Basics of AWS CLI

I wanted to show you how to work with AWS CLI practically. But I don’t have a credit card, so I can’t verify my AWS account. But don’t worry; I will give you enough information so that you can get started with AWS CLI on Ubuntu 22.04 LTS.

Читайте также:  Upsmon pro linux установка

In this section, I will be using the Ubuntu 22.04 LTS packaged version of the AWS CLI program, not the Python module version. So, make sure to adjust the command if you’re using the Python module version of the AWS CLI program.

Login to AWS Account Using AWS CLI

First, you have to use your AWS account credentials to configure the AWS CLI client. To do that, run the following command:

Ubuntu Packaged AWS CLI:

AWS CLI Python Module:

Type in your AWS Access Key ID and press .

NOTE: An Access Key ID can be created from the AWS Management Console.

Type in your AWS Secret Access Key ID and press .

NOTE: A Secret Access Key ID can be created from the AWS Management Console.

Type in your default region name. It’s something like us-west-2. Once you’re done, press .

Type in your default output format. If the output format does not matter much to you, just press to choose the default output format.

If you prefer to use the JSON (JavaScript Object Notation) output format, type in json and press .

Once you’ve configured the AWS CLI program with your AWS account credentials, you should be able to manage your Amazon Web Services using AWS CLI.

The configuration files of the AWS CLI program are stored in the ~/.aws/config and ~/.aws/credentials files, as you can see in the screenshot below.

If you want to use different AWS account credentials, you have to delete the ~/.aws/config and ~/.aws/credentials files with the following command and run the aws configure command again.

Getting Help With AWS CLI

To figure out how to use the AWS CLI program, you can read the AWS CLI man pages. AWS also has a great guide and online documentation on AWS CLI that you can read to learn more about AWS CLI.

To get help on the AWS CLI program from the terminal, you can run the following command:

Источник

Оцените статью
Adblock
detector