use of com.amazonaws.services.secretsmanager.model.AWSSecretsManagerException in project kork by spinnaker.
the class SecretsManagerSecretEngine method getSecretValue.
protected GetSecretValueResult getSecretValue(String secretRegion, String secretName) {
AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard().withRegion(secretRegion).build();
GetSecretValueRequest getSecretValueRequest = new GetSecretValueRequest().withSecretId(secretName);
try {
return client.getSecretValue(getSecretValueRequest);
} catch (AWSSecretsManagerException e) {
throw new SecretException(String.format("An error occurred when using AWS Secrets Manager to fetch: [secretName: %s, secretRegion: %s]", secretName, secretRegion), e);
}
}
Aggregations