title: Not able to access DynamoDB table
body: <p>I am following this <a href="http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/dynamodb_om.html" rel="nofollow noreferrer">tutorial</a> and have setup the DynamoDB table and permissions as described, but the app crashes saying:</p>
  
  <blockquote>
    <p>CognitoIdentityCredentials is not authorized to perform: dynamodb:UpdateItem on resource: arn:aws:dynamodb:us-east-1:some_number:table/Books" (The table which I am trying to access is on us-west-2). </p>
  </blockquote>
  
  <p>Please find below the code and the error:</p>
  
  <p>Code:</p>
  
  <pre><code>setContentView(R.layout.activity_main);
  Runnable runnable = new Runnable() {
      public void run() {
          //DynamoDB calls go here
          CognitoCachingCredentialsProvider credentialsProvider=new CognitoCachingCredentialsProvider(getApplicationContext(),"us-west-2:some_num", Regions.US_WEST_2);
          AmazonDynamoDBClient ddbClient = new AmazonDynamoDBClient(credentialsProvider);
          DynamoDBMapper mapper = new DynamoDBMapper(ddbClient);
          Book book = new Book();
          book.setTitle("Great Expectations");
          book.setAuthor("Charles Dickens");
          book.setPrice(1299);
          book.setIsbn("12345678901");
          book.setHardCover(false);
          mapper.save(book);
          Toast.makeText(MainActivity.this,String.valueOf(mapper), Toast.LENGTH_LONG).show();
      }
  };
  Thread mythread = new Thread(runnable);
  mythread.start();
  </code></pre>
  
  <p><strong>Error</strong>:</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: Thread-9530
  Process: com.example.imb_bng_04.dynamodb, PID: 30264
  com.amazonaws.AmazonServiceException: User: arn:aws:sts::some_number:assumed-role/Cognito_sampleapp2Unauth_Role/CognitoIdentityCredentials is not authorized to perform: dynamodb:UpdateItem on resource: arn:aws:dynamodb:us-east-1:some-number:table/Books (Service: AmazonDynamoDB;
  Status Code: 400; Error Code: AccessDeniedException; Request ID: NMSNFJB24D6G3MO8RL6H624FA)
  at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:712)
  at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:388)
  at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:199)
  at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:4181)
  at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.updateItem(AmazonDynamoDBClient.java:1582)
  at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$SaveObjectHandler.doUpdateItem(DynamoDBMapper.java:1173)
  at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$2.executeLowLevelRequest(DynamoDBMapper.java:873)
  at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$SaveObjectHandler.execute(DynamoDBMapper.java:1056)
  at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:904)
  at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:688)
  at com.example.imb_bng_04.dynamodb.MainActivity$1$override.run(MainActivity.java:32)
  at com.example.imb_bng_04.dynamodb.MainActivity$1$override.access$dispatch(MainActivity.java)
  at com.example.imb_bng_04.dynamodb.MainActivity$1.run(MainActivity.java:0)
  at java.lang.Thread.run(Thread.java:818)
  01-27 18:10:16.004 1430-4135/? E/ActivityManager: Invalid thumbnail dimensions: 0x0
  </code></pre>
  
  <p>Any help with this would be greatly appreciated.</p>