gcp

package
v1.200.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientOptions

func GetClientOptions(opts AuthOptions) []option.ClientOption

GetClientOptions returns Google Cloud client options based on the provided authentication configuration. This function provides unified authentication handling across all Google Cloud services in Atmos.

Authentication precedence: 1. Explicit credentials (JSON content or file path) 2. Application Default Credentials (ADC) which automatically handles:

  • GOOGLE_APPLICATION_CREDENTIALS environment variable
  • Compute Engine metadata service
  • Cloud Shell credentials
  • gcloud user credentials (from `gcloud auth application-default login`)
  • Workload Identity (in GKE)

func GetCredentialsFromBackend

func GetCredentialsFromBackend(backend map[string]any) string

GetCredentialsFromBackend extracts credentials from a Terraform backend configuration. This is used by the GCS Terraform backend.

func GetCredentialsFromStore

func GetCredentialsFromStore(credentials *string) string

GetCredentialsFromStore extracts credentials from a store configuration. This is used by the Google Secret Manager store.

Types

type AuthOptions

type AuthOptions struct {
	// Credentials can be either:
	// - JSON content (if starts with "{")
	// - File path to service account JSON file
	// - Empty string to use Application Default Credentials (ADC)
	Credentials string
}

AuthOptions contains configuration for Google Cloud authentication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL