DynamoDB
ArrayList<AttributeDefinition> attributeDefinitions = new
ArrayList<>();
attributeDefinitions.add(new AttributeDefinition()
.withAttributeName("ID").withAttributeType("S"));
ArrayList<KeySchemaElement> keySchema = new ArrayList<>();
keySchema.add(new KeySchemaElement()
.withAttributeName("ID").withKeyType(KeyType.HASH));
CreateTableRequest createTableReq = new CreateTableRequest()
.withTableName("Product")
.withAttributeDefinitions(attributeDefinitions)
.withKeySchema(keySchema)
.withProvisionedThroughput(new
ProvisionedThroughput()
.withReadCapacityUnits(10L)
.withWriteCapacityUnits(5L));
CreateTableResult result = dynamodb.createTable(createTableReq);
System.out.println(result.toString());
If I want to create a table like this where can I put this code to work just once, is there any migration script tool or something like that?