user3288747
user3288747

Reputation: 85

dynamodb cannot get list of tables

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

Answers (1)

Sony Kadavan
Sony Kadavan

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

Related Questions