In this tutorial, you created the
Movies table in DynamoDB on your computer and
performed basic operations. DynamoDB Local is useful during application development and
testing. However, when you are ready to run your application in a production
environment, you need to modify your code so that it uses the Amazon DynamoDB service.
Using the Amazon DynamoDB Service
You need to change the endpoint in your application in order to use the Amazon DynamoDB service as follows. To do this, first remove the following line:
ddbConfig.ServiceURL = "http://localhost:8000";
Next, add a new line that specifies the AWS region you want to access:
ddbConfig.RegionEndpoint = RegionEndpoint.
For example, if you want to access the
us-west-2 region, you would do
ddbConfig.RegionEndpoint = RegionEndpoint.USWest2;
Instead of using DynamoDB Local, the program now uses the DynamoDB service endpoint 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 AWS Region Selection in the AWS SDK for .NET Developer Guide.
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.