Reputation: 1829
I'm using DynamoDB, where "User" is the Table and Model Object name. I get this error:
Requested resource not found: Table: User not found
web.config settings are as below.
<appSettings>
<add key="AWSAccessKey" value="asdf" />
<add key="AWSSecretKey" value="Vi+asdfsecretImnottelling" />
</appSettings>
I'm currently using my localhost to debug my application. Is this allowed?
Upvotes: 2
Views: 7210
Reputation: 155
Create user by using IAM, it is a AWS service. Then do the following configuration in your app settings according to the user you have added:
"AWS": {
"Profile": "",
"AccessKey": "",
"SecretKey": "",
"Region": ""}
The following method is easy to create DynamoDb client with basic credential:
AmazonDynamoDBClient awsDbClient = new AmazonDynamoDBClient(strAccessKey, strSecretKey, Amazon.RegionEndpoint.GetBySystemName(strRegion));
For aws DB access library you can visit this link: https://github.com/MeghnathDas/DynamoDbPlugin
Upvotes: 0
Reputation: 1829
I didn't set the ServiceURL
which is a problem as I'm not using the default region.
By default, AWS SDK for .NET sets the endpoint to
https://dynamodb.us-east-1.amazonaws.com
You can also set the endpoint explicitly as shown in this C# code snippet:
private static void CreateClient()
{
AmazonDynamoDBConfig config = new AmazonDynamoDBConfig();
config.ServiceURL = "http://dynamodb.us-east-1.amazonaws.com";
client = new AmazonDynamoDBClient(config);
}
Amazon's "What Is Amazon DynamoDB?" will help too.
Upvotes: 1