in src/main/java/com/aws/logaggregator/config/DynamoDBConfigHolder.java [51:85]
public void loadLogConfigFiles(String tableName, String key, String region) {
String endpoint = "dynamodb." + region + ".amazonaws.com";
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))
.build();
DynamoDB dynamoDB = new DynamoDB(client);
String config = retrieveItem(dynamoDB, tableName, key);
JSONObject obj = null;
if (config != null) {
obj = new JSONObject(config);
}
//this.region = region;
try {
String fileConfigData = secretParam.substituteSecrets(obj.get(logconfig).toString());
String finalConfigData = secretParam.substituteConfigArgs(fileConfigData);
logAggregatorMetadata = initializeLogMetadata(finalConfigData);
try {
if (obj.get(schema) != null && !"".equals(obj.get(schema).toString())) {
this.logschema = initializeLogSchema(obj.get(schema).toString());
}
} catch (Exception e) {
logger.debug("Couldn't find schema for the key-->" + key + "-->" + e.getMessage());
}
} catch (Exception e) {
logger.error("Please ensure you have provided the right key for retrieving the config files and make sure you have " +
"connectivity and access " +
"to DynamoDB plus the jsons are saved in proper format", e);
}
}