Class GcpContextAutoConfiguration
java.lang.Object
com.google.cloud.spring.autoconfigure.core.GcpContextAutoConfiguration
@AutoConfiguration
@ConditionalOnProperty(name="spring.cloud.gcp.core.enabled",
havingValue="true",
matchIfMissing=true)
@EnableConfigurationProperties(GcpProperties.class)
public class GcpContextAutoConfiguration
extends Object
Base starter for Google Cloud Projects. Provides defaults for
GoogleCredentials
. Binds properties from GcpProperties
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GcpEnvironmentProvider
Provides default implementation for determining GCP environment.Get a GCP project ID provider.com.google.api.gax.core.CredentialsProvider
-
Constructor Details
-
GcpContextAutoConfiguration
-
-
Method Details
-
googleCredentials
@Bean @ConditionalOnMissingBean public com.google.api.gax.core.CredentialsProvider googleCredentials() throws IOException- Throws:
IOException
-
gcpProjectIdProvider
Get a GCP project ID provider.- Returns:
- a
GcpProjectIdProvider
that returns the project ID in the properties or, if none, the project ID from the GOOGLE_CLOUD_PROJECT envvar and Metadata Server
-
gcpEnvironmentProvider
Provides default implementation for determining GCP environment. Can be overridden to avoid interacting with real environment.- Returns:
- a GCP environment provider
- Since:
- 1.1
-