AWS CLI quick startΒΆ

The Amazon Web Services (AWS) command line tool is a full-featured alternative to using the AWS console to perform actions in your account. Getting started is dead simple. I assume you have an AWS account and access to your Access Key ID and Secret Access Key. If that’s not true, you can read our getting started guide.

  1. Install the tool
pip install awscli
  1. Add your credentials
aws configure

Enter the AWS Access Key ID and AWS Secret Access Key when prompted. You’ll also need to set Default region name. I use us-east-1 for the region which is in Northern Virginia. This is a good region because all of the services are available there. It may be better to pick a different region if you live more than about 2,000 miles from Virginia.

  1. Confirm the AWS CLI tool is working
aws ec2 describe-instances

If you have running instances, you’ll get a JSON response back with information in it. Otherwise, you should still see a JSON response:

{
   "Reservations": []
}

If you get an error, make sure your user has an access key with sufficient permissions to describe EC2 instances.

Comments

comments powered by Disqus