Installing and Configuring the AWS Command Line Interface (CLI)

The AWS CLI allows you to manage your Amazon Web Services account from the command line. This guide explains how to install and configure it on your account.


Prerequisites

  • An active AWS account. If you do not have one, create it at http://aws.amazon.com.

  • An AWS user with an Access Key and Secret Key. You create these by setting up a user group and user in the AWS console.

For guidance on creating users and obtaining keys, see:


Installing the AWS CLI

  1. Log in via SSH to your hosting account.

  2. Create a Python virtual environment:

cd ~
virtualenv amazon
  1. Activate the virtual environment:

source ~/amazon/bin/activate
  • The command prompt changes to (amazon)username@example.com, indicating you are inside the virtual environment.

  1. Install the awscli package:

pip install awscli
  1. Make the AWS CLI executable:

chmod +x ~/amazon/bin/aws

Configuring the AWS CLI

  1. Run the configuration command:

aws configure
  1. Enter the required details when prompted:

  • AWS Access Key ID: Enter the AWS user's Access Key.

  • AWS Secret Access Key: Enter the AWS user's Secret Key.

  • Default region name: Press Enter to skip or specify a region.

  • Default output format: Press Enter to skip or specify a format (e.g., json, text, table).

The AWS CLI is now configured for your account.


Using the AWS CLI

  • To view available commands:

aws help

For more information, visit AWS CLI.

¿Le ha resultado útil esta respuesta? 0 Los usuarios encontraron esto útil (0 Votos)

Powered by WHMCompleteSolution