Configure AWS CLI

This guide will walk you through configuring the AWS CLI (aws) for your IAM user.

Note

If you have already configured aws for your IAM user, you may proceed to the Verify section.

What You’ll Need

  • An AWS account.
  • An IAM user with elevated privileges.
  • The Access Key ID for this IAM user.
  • The Secret Access Key for this IAM user.

Procedure

Create and configure the default AWS profile. During this step, you will need to provide your AWS credentials and a default region:

root@rok-tools:~# aws configure
AWS Access Key ID [None]: *****************XYZ
AWS Secret Access Key [None]: *****************xyz
Default region name [None]: us-east-1
Default output format [None]:

Once the above command completes you should see the following files in your management environment:

  • AWS configuration file, at /root/.aws/config.
  • AWS credentials file, at /root/.aws/credentials.

Note

In case you already have an AWS CLI configuration that you want to reuse, you can copy the config and credentials files into the rok-tools container using docker cp or kubectl cp depending on your environment.

Verify

  1. Verify you have successfully signed in to your account:

    root@rok-tools:~# aws sts get-caller-identity
    {
        "UserId": "AIDASAMPLEUSERID",
        "Account": "123456789012",
        "Arn": "arn:aws:iam::123456789012:user/DevAdmin"
    }
    
  2. Verify you can access Amazon Kubernetes Service:

    root@rok-tools:~# aws eks list-clusters
    {
        "clusters": []
    }
    

Summary

You have successfully configured the AWS CLI for your IAM user in your management environment.

What’s Next

The next step is to set up your cloud environment.