I have created a Java Lambda function which is meant to persist to DynamoDB table, deploying with AWS SAM. I observed there are no error logs from the persistence attempt, the Lambda just times out
public static AmazonDynamoDB getDynamoInstance() {
if (DYNAMO_INSTANCE == null) {
AmazonDynamoDBClientBuilder amazonDynamoDBClientBuilder = AmazonDynamoDBClientBuilder.standard()
.withRegion(REGION);
DYNAMO_INSTANCE = amazonDynamoDBClientBuilder.build();
}
return DYNAMO_INSTANCE;
}
public void putItemInEventHistory(String event) {
DynamoDB dynamoDB = new DynamoDB(DynamoDBFactory.getDynamoInstance());
Table table = dynamoDB.getTable(EVENTS_HISTORY_TABLE_NAME);
Item item = new Item()
.withPrimaryKey("Id", 210)
.withJSON("event", event);
PutItemOutcome outcome = table.putItem(item);
}
Could someone point me in the right direction to troubleshoot.
Cheers Kris