use of com.google.cloud.secretmanager.v1.SecretManagerServiceSettings in project nomulus by google.
the class SecretManagerModule method provideSecretManagerClient.
@Provides
@Singleton
static SecretManagerClient provideSecretManagerClient(SecretManagerServiceSettings serviceSettings, @Config("projectId") String project, Retrier retrier) {
try {
SecretManagerServiceClient stub = SecretManagerServiceClient.create(serviceSettings);
Runtime.getRuntime().addShutdownHook(new Thread(stub::close));
return new SecretManagerClientImpl(project, stub, retrier);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations