Sayem helps you prepare
an Amazon EC2 environment
for Amazon DynamoDB and the CLI


How do I set up and configure the AWS Command Line Interface (AWS CLI) for working with Amazon DynamoDB on Amazon EC2?

Create an AWS Identity and Access Management (IAM) role

  1. Follow the steps for Creating a Role for an AWS Service (Console).
  2. Choose EC2 as the AWS service.
  3. Choose AmazonDynamoDBFullAccess as the permissions policy for the role.

Attach the IAM role to an Amazon Elastic Compute Cloud (Amazon EC2) instance

  1. Follow the steps for Launching an Instance Using the Launch Instance Wizard.
  2. Choose an Amazon Linux AMI which come with the AWS CLI already installed.
  3. On the Configure Instance Details page, select your new IAM role from the IAM role drop-down menu.
  4. Be sure that the subnet that you select is accessible from the Internet.
  5. On the Configure Security Group page, be sure that you select a security group that allows SSH access from your IP address.

Connect to the instance using SSH

  1. Follow the steps for Connecting to Your Linux Instance Using SSH.
  2. After you are connected, run the yum update command to be sure that all the software packages on your instance are up to date.

Configure the AWS CLI

  1. Run the aws configure command.
  2. When prompted for AWS Access Key ID and AWS Secret Access Key, press Enter.
    You do not need to provide keys because you are using an instance IAM role to connect with an AWS service.
  3. When prompted for Default region name, enter the name of the Region where your DynamoDB tables are located. For example, ap-southeast-2.
    For a complete list of Region names, see AWS Regions and Endpoints—Amazon DynamoDB.
  4. When prompted for Default output format, press Enter.
  5. Run the list-tables command to confirm that you can run DynamoDB commands on the AWS CLI.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-07-25