Connect to the AWS CLI in Windows to manage your environment programatically

This is just a quick guide to show you how to connect to AWS (Amazon Web Services) using the CLI.

1. Download AWS CLI from here

2. Login to your AWS console and go to IAM.  Create a new user account with programmatic access only.  Then lock down the new account by creating a new policy with only the exact permissions you will need within the CLI.  Attach the policy to your new account.  (If you already have a suitable account you can skip this step).

3. Open a command prompt and change directory to your AWS CLI path C:\Program Files\Amazon\AWSCLI>

4. Type the below for AWS to collect your login credentials to allow you to connect:

aws configure

 

You should see a prompt stating the below, enter your Access ID here.

AWS Access Key ID [None]:

You should then see a prompt asking for your secret key, enter this here.

AWS Secret Access Key [None]:

You should then see a prompt asking you to enter your region, enter your region here.

Default region name [None]:

Select your default output format as json as below.

Default output format [None]: json

You are now connect run a command such as the below to test:

aws ec2 describe-regions --output table

Leave a Reply

Your email address will not be published. Required fields are marked *