compared to Parse, AWS has a bit of learning curve :)
- I created a table in dynamodb called "dynamotest"
- IAM shows that I have the following role (policygen-Cognito_awst1Unauth_Role-201603071632) defined:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1457368244000", "Effect": "Allow", "Action": [ "dynamodb:*" ], "Resource": [ "arn:aws:dynamodb:eu-west-1:579313493028:table/dynamotest" ] } ] }
in the Xamarin app I have the following code:
// test access to Dynamo
var client = new AmazonDynamoDBClient(credentials, RegionEndpoint.EUWest1);
Table table = Table.LoadTable(client, "dynamotest");
var book = new Document();
book["Id"] = 101;
book["Title"] = "Book 101 Title";
book["ISBN"] = "11-11-11-11";
book["Authors"] = new List<string> { "Author 1", "Author 2" };
book["InStock"] = new DynamoDBBool(true);
book["QuantityOnHand"] = new DynamoDBNull();
table.PutItemAsync(book);
"credentials" are the Cognito credentials for unauthenticated useder created with the Cognito identity pool id. Cognito-Synching with those credentials works fine.
Running this code there is no data put in the table.I also tried using the object persistence model with the same result.
What step(s) am I missing? There is no error - if the data wasn't missing from the table I wouldn't even know that something was wrong.
So two questions: 1/ How do enable access to Dynamodb for the unauthenticated Cognito users. Do I need to create some arbitrary user and attach the role/policy??? Is there an issue with the Regionpoint (as I am in Europe)?
2/ How can I check for errors/problems using the AWS SDK for Xamarin??
Please help - thanks!!