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:
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.
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.
For example, if you want to use the us-west-2 region, you set the following region:
The program now uses the Amazon DynamoDB web service region in US West (Oregon).
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
Go to the AWS Command Line Interface User Guide.
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.