Menu
Amazon DynamoDB
Getting Started Guide (API Version 2012-08-10)

Summary

In this tutorial, you created the Movies table in DynamoDB on your computer and performed basic operations. The downloadable version of DynamoDB is useful during application development and testing. However, when you are ready to run your application in a production environment, you want to modify your code so that it uses the Amazon DynamoDB web service.

To modify your code so that it uses the Amazon DynamoDB service, do the following:

  1. Sign up for Amazon Web Services and create access keys. You need these credentials to use the AWS SDKs. To create an AWS account, go to https://aws.amazon.com/, choose Create an AWS Account, and then follow the online instructions.

  2. Update the AWS Configuration Region.

  3. Install and Configure the AWS CLI.

  4. Configure AWS Credentials in Your Files Using Amazon Cognito.

Update the AWS Configuration Region

You need to update the region in your application to use the Amazon DynamoDB web service. You also need to make sure Amazon Cognito is available in that same region, so your browser scripts can authenticate successfully.

Copy
AWS.config.update({region: "aws-region"});

For example, if you want to use the us-west-2 region, you set the following region:

Copy
AWS.config.update({region: "us-west-2"});

The program now uses the Amazon DynamoDB web service region in US West (Oregon).

Amazon DynamoDB is available in several regions worldwide. For the complete list, see Regions and Endpoints in the AWS General Reference. For more information about setting regions and endpoints in your code, see Setting the Region in the AWS SDK for JavaScript Getting Started Guide.

Install and Configure the AWS CLI

After you have obtained your AWS access key ID and secret key, you can set up the AWS CLI on your computer.

To install and configure the AWS CLI

  1. Go to the AWS Command Line Interface User Guide.

  2. Follow the instructions for Installing the AWS CLI and Configuring the AWS CLI.

Configure AWS Credentials in Your Files Using Amazon Cognito

The recommended way to obtain AWS credentials for your web and mobile applications is to use Amazon Cognito. Amazon Cognito helps you avoid hardcoding your AWS credentials on your files. Amazon Cognito uses IAM roles to generate temporary credentials for your application's authenticated and unauthenticated users.

For more information, see Configure AWS Credentials in Your Files Using Amazon Cognito.

Finally, we recommend that you read the Amazon DynamoDB Developer Guide. It provides more in-depth information about DynamoDB, including sample code and best practices.