internal

package
v1.47.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TerraformVarSubscriptionID is the name of the terraform subscription id environment variable.
	TerraformVarSubscriptionID = "TF_VAR_SUBSCRIPTION_ID"
	// TerraformVarTenantID is the name of the terraform tenant id environment variable.
	TerraformVarTenantID = "TF_VAR_TENANT_ID"
	// TerraformVarClientID is the name of the terraform client id environment variable.
	TerraformVarClientID = "TF_VAR_CLIENT_ID"
	// TerraformVarClientSecret is the name of the client secret environment variable.
	TerraformVarClientSecret = "TF_VAR_CLIENT_SECRET"
)

Variables

View Source
var (
	// NewTerraformer initializes a new Terraformer. Exposed for testing
	NewTerraformer = defaultNewTerraformer

	// NewTerraformerWithAuth initializes a new Terraformer that has the azure auth credentials. Exposed for testing
	NewTerraformerWithAuth = defaultNewTerraformerWithAuth
)

Functions

func GetAuthorizerAndSubscriptionID added in v1.15.0

func GetAuthorizerAndSubscriptionID(clientAuth *ClientAuth) (azureautorest.Authorizer, string, error)

GetAuthorizerAndSubscriptionID creates and returns an Azure Authorizer and a subscription id

func GetAuthorizerAndSubscriptionIDFromSecretRef added in v1.40.0

func GetAuthorizerAndSubscriptionIDFromSecretRef(ctx context.Context, c client.Client, secretRef corev1.SecretReference, allowDNSKeys bool) (azureautorest.Authorizer, string, error)

GetAuthorizerAndSubscriptionIDFromSecretRef retrieves the client auth data specified by the secret reference to create and return an Azure Authorizer and a subscription id.

func TerraformerEnvVars added in v1.15.0

func TerraformerEnvVars(secretRef corev1.SecretReference) []corev1.EnvVar

TerraformerEnvVars computes the Terraformer environment variables from the given secret reference.

Types

type ClientAuth

type ClientAuth struct {
	// SubscriptionID is the Azure subscription ID.
	SubscriptionID string `yaml:"subscriptionID"`
	// TenantID is the Azure tenant ID.
	TenantID string `yaml:"tenantID"`
	// ClientID is the Azure client ID.
	ClientID string `yaml:"clientID"`
	// ClientSecret is the Azure client secret.
	ClientSecret string `yaml:"clientSecret"`
}

ClientAuth represents a Azure Client Auth credentials.

func GetClientAuthData

func GetClientAuthData(ctx context.Context, c client.Client, secretRef corev1.SecretReference, allowDNSKeys bool) (*ClientAuth, error)

GetClientAuthData retrieves the client auth data specified by the secret reference.

func NewClientAuthDataFromSecret added in v1.40.0

func NewClientAuthDataFromSecret(secret *corev1.Secret, allowDNSKeys bool) (*ClientAuth, error)

NewClientAuthDataFromSecret reads the client auth details from the given secret.

func (ClientAuth) GetAzClientCredentials added in v1.40.0

func (clientAuth ClientAuth) GetAzClientCredentials() (*azidentity.ClientSecretCredential, error)

GetAzClientCredentials returns the credential struct consumed by the Azure client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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