JamesBranam's Blog

Thursday Jul 09, 2009

AWS Experience Part 11: AWS EC2 Toolkit

Hi all,

Although the AWS Management Console is an adequate tool for most tasks you may need to perform in the cloud, at some point you will need to use the commnd line to perform certain tasks. Also, for those users who are used to using the command line with other applications may find it easier and faster to use AWS EC2 AMI tools while working with their AMI.

The AWS EC2 Toolkit makes it easy to perform a number of tasks. Here are a few commonly used commands:

  • ec2-describe-region. Use this command to view available regions.
  • export EC2_URL=https://<service_endpoint>. This command changes a region.
    Note: Windows users: set EC2_URL=https://<service_endpoint>
  • ec2-describe-images -o self -o amazon | grep machine . Use this command to find a suitable AMI.
  • ec2-add-keypair gsg-keypair. Use this command to add a key pair.
  • ec2-run-instances ami-235fba4a -k gsg-keypair. This command launches an AMI.
  • ec2-describe-instances i-ae0bf0c7. Use this to display the launch status of an instance.
  • ec2-authorize default -p 22. This commands authorizes access to an instance.
  • ssh -i id_your-keypair root@ec1-23-456-789.compute-1.amazonaws.com. Use this to access an instance.
  • # ec2-bundle-vol -d /mnt -k /mnt/pk-HKZ3YTJCMXYI9JHUAHSY5CLO.pem -c /mnt/cert-HKZ3YTJCMXYI9JHUAHSY5CLO.pem -u AIDADWWJSKSKSKD -r i386 -p sampleimage. This command bundles an instance. Note:This command must be executed from the AMI instance.
  • ec2-upload-bundle -b <your-s3-bucket> -m /mnt/sampleimage.manifest.xml -a <aws-access-key-id> -s <aws-secret-access-key> Use this command to upload your custom AMI to your AWS S3 bucket.
  • ec2-register <your-s3-bucket>/sampleimage.manifest.xml. This command registers the new AMI with AWS.

Cheers!

--James

Comments:

Post a Comment:
Comments are closed for this entry.

Calendar

Feeds

Search

Links

Navigation

Referrers