Amazon EC2 CLI Installation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 29: Line 29:
Set JAVA_HOME for all accounts that are going to use ec2 tools.
Set JAVA_HOME for all accounts that are going to use ec2 tools.


!!Set Environment
==Set Environment==


For all users that are going to use it:
For all users that are going to use it:
Line 37: Line 37:
export PATH=${PATH}:${EC2_HOME}/bin
export PATH=${PATH}:${EC2_HOME}/bin
}}}
}}}


!!Set the Access Keys
!!Set the Access Keys

Revision as of 17:27, 11 February 2016

External

Internal

Download

wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip

Unzip

cd /opt
unzip .../ec2-api-tools.zip
ln -s ./ec2-api-tools-1.7.5.1 ec2-api-tools

Adjust the command to reflect the actual EC2 API tools version.

Post-Install

Set JAVA_HOME

Set JAVA_HOME for all accounts that are going to use ec2 tools.

Set Environment

For all users that are going to use it:

{{{ export EC2_HOME=/opt/ec2 export PATH=${PATH}:${EC2_HOME}/bin }}}

!!Set the Access Keys

More details about access keys here: |[Amazon Security#APIAccessKeys]


Access keys can be specified on command line every time an ec2 command is issued, with:

{{{ -aws-access-key or -O --aws-secret-key or -W }}}

or by setting the following environment variables:

{{{ export AWS_ACCESS_KEY=your-aws-access-key-id export AWS_SECRET_KEY=your-aws-secret-key }}}


!!Test

{{{ ec2-describe-regions }}}

!!Set the Region

{{{ export EC2_URL=https://<service_endpoint> }}}


!!!Commands


|[ec2-describe-regions] |[ec2-describe-instances] |[ec2-start-instances] |[ec2-import-instance] |[ec2-run-instances] |[ec2-create-tags]