gcp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gcpauth provides GCP Workload Identity Federation for simrun. When a GCP connector is configured with WIF, simrun generates an external account credential configuration that the Google Cloud SDK uses to exchange AWS credentials for GCP access tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCredentialConfig

func BuildCredentialConfig(cfg WIFConfig) (string, error)

BuildCredentialConfig generates a Google Cloud external account credential configuration JSON for AWS workload identity federation. The returned JSON can be set as GOOGLE_CREDENTIALS for the Google SDK to automatically exchange AWS credentials for GCP access tokens.

func BuildCredentialFile

func BuildCredentialFile(cfg WIFConfig) (string, error)

BuildCredentialFile writes the WIF credential config JSON to a temporary file and returns the file path. This is needed because the GCP SDK's ADC chain reads GOOGLE_APPLICATION_CREDENTIALS (a file path), not GOOGLE_CREDENTIALS (inline JSON which is Terraform-specific).

Types

type WIFConfig

type WIFConfig struct {
	ProjectNumber       string `json:"project_number"`
	PoolID              string `json:"pool_id"`
	ProviderID          string `json:"provider_id"`
	ServiceAccountEmail string `json:"service_account_email"`
}

WIFConfig holds the Workload Identity Federation configuration.

Jump to

Keyboard shortcuts

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