liveBook · Manning

API key

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

An AWS access key is a credential consisting of an access key identifier and a secret access key for programmatic authentication.

An AWS access key is a programmatic credential made of an access key identifier and a secret access key. The AWS CLI uses these values to authenticate as an IAM user, while console sign-in uses a username and password. section 4.2.2 section 5.3.4

Handle access keys as high-impact credentials:

  • Treat both values as top secret because anyone who obtains them may gain the permissions assigned to the IAM user. section 4.2.2
  • Prefer an IAM user with only the permissions required for its role instead of using the AWS account root user. section 5.3 section 5.3.4
  • Enable multifactor authentication for users, especially users with administrator access. section 5.3.4

Configure and test the AWS CLI

Create an IAM user with programmatic access, copy its access key identifier and secret access key, then run aws configure in a terminal. Enter the credentials, choose us-east-1 as the default region, select json output, and test authentication with aws ec2 describe-regions. section 4.2.2

$ aws configure
 AWS Access Key ID [None]:  AKIAIRUR3YLPOSVD7ZCA   #1
 AWS Secret Access Key [None]: 
 SSKIng7jkAKERpcT3YphX4cD87sBYgWVw2enqBj7        #2
 Default region name [None]: us-east-1
 Default output format [None]: json
#1 Your value will be different! Copy it from your browser window.
#2 Your value will be different! Copy it from your browser window.

Shows the smallest useful aws configure sequence with placeholders for the access key values, region, and output format. section 4.2.2

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Defines the credential pair, demonstrates CLI configuration and testing, and stops short of credential rotation or storage mechanisms.
Examples
Uses aws configure followed by aws ec2 describe-regions to demonstrate credential setup and authentication.
What it assumes
Assumes an AWS account and IAM access, while teaching the distinction between root users, IAM users, console passwords, and access keys.
What you can do after
Operate the AWS CLI by configuring access keys and verifying authentication with an EC2 regions query.
How it connects
Connects access keys with IAM users, the AWS CLI, least privilege, MFA, and the AWS account root user.

Also explained in

Compare how 13 books explain API key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.