Difference between revisions of "Installing AWS command-line tools"

From Notes_Wiki
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb>Amazon_web_services|Amazon web services</yambe:breadcrumb>
[[Main_Page|Home]] > [[Amazon web services]] > [[Installing AWS command-line tools]]
=Installing EC2 command-line tools=


# Verify python version is greater than 2.6 with '<tt>python --version</tt>'
The below steps are for installing updated AWS CLI version 2 on CentOS
# Install pip using '<tt>sudo yum -y install python-pip</tt>'
# Ensure that following packages are installed
# To install aws-cli use '<tt>sudo pip install awscli</tt>'
# To upgrade use '<tt>pip install --upgrade awscli</tt>'
# Create '<tt>~/.aws/config</tt>' file with following contents:
#:<pre>
#:<pre>
#::[default]
#:: dnf install less glibc groff-base unzip curl
#::aws_access_key_id = <key-id>
#::aws_secret_access_key = <key>
#::region = <region>
#:</pre>
#:</pre>
#If use of environment variables is desired instead of config files then use:
# Download latest AWS CLI version using:
#:<pre>
#:<pre>
#::export AWS_DEFAULT_REGION=<region>
#:: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
#::export AWS_ACCESS_KEY_ID=<key-id>
#::export AWS_SECRET_ACCESS_KEY=<key>
#:</pre>
#:</pre>
#If there is need to access more than one AWS account then separate configuration file can be created for each at desired location and then use:
# Unzip and install awscli
#:<pre>
#:<pre>
#::export AWS_CONFIG_FILE=<config-file>
#:: unzip awscliv2.zip
#:: ./aws/install  #As root user
#:</pre>
# Check installed version
#:<pre>
#:: aws --version
#:</pre>
# Configure installed awscli with AWS access key ID, secret key, region, etc. using:
#:<pre>
#:: aws configure
#:</pre>
# Test the configuration with some command such as:
#:<pre>
#:: aws s3 ls
#:: aws lightsail get-instances | grep -C1 arn | grep -i name
#:</pre>
#:</pre>
#::to select desired config file


Try '<tt>aws help</tt>', '<tt>aws ec2 help</tt>', etc. to learn how to use command-line tools.


Refer:
* https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html




<yambe:breadcrumb>Amazon_web_services|Amazon web services</yambe:breadcrumb>
[[Main_Page|Home]] > [[Amazon web services]] > [[Installing AWS command-line tools]]

Latest revision as of 05:21, 18 April 2022

Home > Amazon web services > Installing AWS command-line tools

The below steps are for installing updated AWS CLI version 2 on CentOS

  1. Ensure that following packages are installed
    dnf install less glibc groff-base unzip curl
  2. Download latest AWS CLI version using:
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
  3. Unzip and install awscli
    unzip awscliv2.zip
    ./aws/install #As root user
  4. Check installed version
    aws --version
  5. Configure installed awscli with AWS access key ID, secret key, region, etc. using:
    aws configure
  6. Test the configuration with some command such as:
    aws s3 ls
    aws lightsail get-instances | grep -C1 arn | grep -i name


Refer:


Home > Amazon web services > Installing AWS command-line tools