How to Install Amazon EC2 CLI Tools on Ubuntu, Debian and Linux Mint - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Monday, October 21, 2019

How to Install Amazon EC2 CLI Tools on Ubuntu, Debian and Linux Mint

 




Installing the AWS Command Line Interface

Install JAVA JRE or JDK
Step1 :-  java –version    or    which java
Step2 :- sudo apt-get install -y openjdk-7-jre

Download and Setup the Amazon API CLI Tools
Step2 :- sudo mkdir /usr/local/ec2
Step3 :- sudo wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip

Notice :- That the .zip file contains a folder ec2-api-tools-x.x.x.x, where x.x.x.x is the version number of the tools (for example, ec2-api-tools-1.7.0.0)

Step4 :- sudo unzip ec2-api-tools.zip  -d   /usr/local/ec2

Download Private Key and Certificate Files
Step5 :- ls -l  /opt/ec2/certs/

Configure Environment
Step7 :- sudo gedit home/cloud/bashrc  or  ~/.bashrc
export EC2_BASE=/opt/ec2
export EC2_HOME=$EC2_BASE/tools


export EC2_PRIVATE_KEY=$EC2_BASE/certs/my-ec2-pk.pem
export EC2_CERT=$EC2_BASE/certs/my-ec2-cert.pem
export EC2_URL=https://ec2.xxxxxxx.amazonaws.com
export AWS_ACCOUNT_NUMBER=
export PATH=$PATH:$EC2_HOME/bin
export JAVA_HOME=/opt/jdk1.8.0_05

Execute
Step8 :- source ~/.bashrc

Verify EC2 Tools Setup
Step10 :- ec2-describe-regions