I am attempting to write a flexible authentication mechanism between using DAX and DynamoDB for performance testing. I have been able to get it to work fine with DynamoDB accross all regions, but it only works correctly in us-west-1 in DAX.
if (this.useDax) {
try {
AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile));
ClientConfig daxConfig = new ClientConfig().withEndpoints(endpoint).withRegion(daxRegion)
.withCredentialsProvider(new AWSStaticCredentialsProvider(credentials));
daxDB = new ClusterDaxClient(daxConfig);
primaryKeyName = primaryKey;
LOGGER.info("dynamodb DAX connection created with " + this.endpoint);
} catch (Exception e1) {
LOGGER.error("DaxDBClient.init(): Could not initialize DaxDB client.", e1);
}
} else {
try {
AWSCredentials credentials = new PropertiesCredentials(new File(credentialsFile));
ClientConfiguration cconfig = new ClientConfiguration();
cconfig.setMaxConnections(maxConnects);
dynamoDB = new AmazonDynamoDBClient(credentials, cconfig);
dynamoDB.setEndpoint(this.endpoint);
primaryKeyName = primaryKey;
LOGGER.info("dynamodb connection created with " + this.endpoint);
} catch (Exception e1) {
LOGGER.error("DynamoDBClient.init(): Could not initialize DynamoDB client.", e1);
}
}
The error I am getting is:
com.amazon.dax.client.exceptions.DaxServiceException: [1.23.31.33] Connection requires authentication (Service: null; Status Code: -1; Error Code: null; Request ID: null)