EC2 Command Line Tool (CentOS)

Install and Configure EC2 Command Line Tool for CentOS

  • Login/sudo as root
  • Install EC2 AMI for CentOS
    cd /tmp
    wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.noarch.rpm
    rpm -Uvh ec2-ami-tools.noarch.rpm
    
  • Downland EC2 API tools
    cd /tmp
    wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
    unzip ec2-api-tools.zip
    
  • Install EC2 API tools
    mkdir /usr/local/ec2/apitools
    mv ec2-api-tools-your-version-num/* /usr/local/ec2/apitools
    

    Change to Your Download version number

  • Cleanup
    rm -r /tmp/ec2-*
    
  • Prepare directory for the key/certificate
    cd
    mkdir .ec2
    chmod og-rwx .ec2
    cd .ec2
    
  • Locate the key/certificate in "EC2 Command Line Tool (Window)"
  • Cut and paste the key/certificate information to
    vi pk-aws.pem
    vi cert-aws.pem
    chmod og-r *.pem
    chmod u-w *.pem
    
  • Edit ~/.bashrc
    export EC2_PRIVATE_KEY=~/.ec2/pk-aws.pem
    export EC2_CERT=~/.ec2/cert-aws.pem
    export JAVA_HOME=/usr/java/default/
    
  • Load the configuration
    source ~/.bashrc
    
  • Test EC2 Tool API
    ec2-describe-images -o self -o amazon