Search in sources :

Example 1 with Unremovable

use of io.quarkus.arc.Unremovable in project quarkus-google-cloud-services by quarkiverse.

the class SecretManagerProducer method secretManagerClient.

@Produces
@Singleton
@Default
@Unremovable
public SecretManagerServiceClient secretManagerClient() throws IOException {
    GcpBootstrapConfiguration gcpConfiguration = gcpConfigHolder.getBootstrapConfig();
    SecretManagerServiceSettings.Builder builder = SecretManagerServiceSettings.newBuilder().setCredentialsProvider(() -> googleCredentials);
    builder.setQuotaProjectId(gcpConfiguration.projectId.orElse(null));
    return SecretManagerServiceClient.create(builder.build());
}
Also used : SecretManagerServiceSettings(com.google.cloud.secretmanager.v1.SecretManagerServiceSettings) GcpBootstrapConfiguration(io.quarkiverse.googlecloudservices.common.GcpBootstrapConfiguration) Produces(javax.enterprise.inject.Produces) Singleton(javax.inject.Singleton) Unremovable(io.quarkus.arc.Unremovable) Default(javax.enterprise.inject.Default)

Aggregations

SecretManagerServiceSettings (com.google.cloud.secretmanager.v1.SecretManagerServiceSettings)1 GcpBootstrapConfiguration (io.quarkiverse.googlecloudservices.common.GcpBootstrapConfiguration)1 Unremovable (io.quarkus.arc.Unremovable)1 Default (javax.enterprise.inject.Default)1 Produces (javax.enterprise.inject.Produces)1 Singleton (javax.inject.Singleton)1