Reputation: 85
I have created tables in AWS DynamoDB and grant the right to ec2 role in policy setting. However, when I run below code with java API, no table is returned. Is there anyone know what I should do?
AWSCredentialsProvider credentialsProvider = new ClasspathPropertiesFileCredentialsProvider();
AmazonDynamoDB dynamoDB = new AmazonDynamoDBClient(credentialsProvider);
return dynamoDB.listTables().getTableNames().toString();
Upvotes: 3
Views: 1936
Reputation: 4072
Yes, by default the calls go to a "default region". Unless your tables are in the same region, this is expected. Better to set the region always.
Upvotes: 4