-- FernandoHaraldBarreiroMegino - 2015-02-25

Usage of EC2 CLI

If you need a new machine for PanDA, get pre-clearance from Sergey Panitkin and Torre Wenaus. They need to confirm your request fits in the budget

Credentials

Someone needs to give you the credentials to be able to use the CLI. Don't make these public!
  • Access Key Id: Username
  • Secret Access Key: Password

Further reading: Understanding EC2 access credentials

Install AWS CLI

On MacOSX, if you already have python&pip installed, it's as simple as:

sudo pip install awscli
sudo pip install --upgrade awscli

For more details and other OS please follow the official installation guide.

Configure AWS CLI

pb-d-128-141-50-158:sec fbarreir$ aws configure
AWS Access Key ID [None]: <YOUR ACCESS KEY ID>
AWS Secret Access Key [None]: <YOUR SECRET ACCESS KEY>
Default region name [None]: us-east-1   #Regions are in http://docs.aws.amazon.com/general/latest/gr/rande.html
Default output format [None]: text    #Can be json, text or table

This creates the folder ~/.aws/

pb-d-128-141-50-158:~ fbarreir$ cd ~/.aws/
pb-d-128-141-50-158:.aws fbarreir$ lls
total 16
-rw-------   1 fbarreir  staff   116 Feb 24 16:19 credentials # The credentials
-rw-------   1 fbarreir  staff    43 Feb 24 16:19 config # The region and output format settings. You can modify your config here directly.

You can have multiple profiles and more advanced settings, but at this point I don't need it. Please follow the official configuration documentation for more information.

Quick guide to AWS CLI

Use the help option for full documentation:

aws help
aws ec2 help
aws ec2 describe-instances help

aws ec2 describe-images --owners self
aws ec2 run-instances --image-id <CHOSEN IMAGE ID> --count 1 --instance-type m1.small --key-name ec2-ATLAS-keys
aws ec2 describe-instances --instance-ids <YOUR INSTANCE ID>
ssh -i ~/.ssh/root_ec2 root@<YOUR NEW IP>

All the details on the CLI: Official get started guide
Official examples on launching a new machine
Official command reference

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2015-02-25 - FernandoHaraldBarreiroMegino
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    PanDA All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback