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 Details

    • GcpContextAutoConfiguration

      public GcpContextAutoConfiguration(GcpProperties gcpProperties)
  • Method Details

    • googleCredentials

      @Bean @ConditionalOnMissingBean public com.google.api.gax.core.CredentialsProvider googleCredentials() throws IOException
      Throws:
      IOException
    • gcpProjectIdProvider

      @Bean @ConditionalOnMissingBean public GcpProjectIdProvider 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

      @Bean @ConditionalOnMissingBean public static GcpEnvironmentProvider 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