Configuring the AWS CLI

The easiest way to configure our local development with our credentials is to run the command `aws configure`

Configuring the AWS CLI#

The easiest way to configure our local development with our credentials is to run the command aws configure. We can then paste in the values for Access Key ID and Secret Access Key that we received from the credentials.csv in previous steps.

For default region name, use the region id that matches whichever region we plan to use the most frequently.

Some common ones:

  • US Virginia: us-east-1

  • US Oregon: us-west-2

  • EU Frankfurt: eu-central-1

Selecting default region

In general, it's good practice to use the region that is physically closes to us (or closest to our customers) to reduce latency. AWS works hard to ensure that there are many regions available, but it's not guaranteed that each region supports every AWS Service. A full breakdown of regions and their supported service endpoints is available at the AWS Documentation page for region endpoints

For our example, we're going to use us-east-1.

So from our terminal, we'll run aws configure and respond to the prompts as shown below.

AWS Access Key ID : If you've already set up your sharedCredentials File) as described in the previous section, this value will be pulled automatically. If it shows a value like [********ABCD], in the prompt, press enter so that it preserves that value. If you did not set up your shared credentials file. Otherwise, paste in the value from the Access Key ID column of the Credentials.csv that was downloaded when you IAM user was created. Hint: Usually starts with "AKIA".

AWS Secret Access Key : If you've already set up your sharedCredentials File) as described in the previous section, this value will be pulled automatically. If it shows a value like [********ABCD], press enter so that it preserves that value. Otherwise, paste in the value from the Secret Access Key Column from the Credentials.csv file that was downloaded when you IAM user was created.

Default region name : Region id - example is using us-east-1

Default output format : output for aws cli commands. recommend using json.

Example:

We now can validate that the aws cli is using the correct keys by running aws sts get-caller-identity.

The UserId should match our AWS Access Key Id from above. Likewise, the Account should match our AWS Account ID, and the Arn should match the Arn for our IAM Admin user.

Some developers may need to manage multiple sets of access keys in order to access multiple AWS Accounts. For any users who need this functionality, research the “profiles” feature for the AWS CLI. More information on setting up local profiles is available on the AWS Documentation page for CLI Configuration

Dice Rolling Slack Bot#

Your local machine is ready to go! Now it's time to move onto the real action: Create a dice Rolling Slack Bot

No discussions yet