config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateVnetSubnet

func ValidateVnetSubnet(vnetSubnet string) error

Types

type Config

type Config struct {
	Credentials Credentials `toml:"credentials"`
	Location    string      `toml:"location"`
	// UseEphemeralStorage is a flag that indicates whether the provider should use
	// ephemeral storage for the VMs it creates. If true, the provider will use the
	// ephemeral OS disk feature to create the VMs. Note, the size of the ephemeral
	// OS disk is determined by the VM size, and the VM size must accomodate the size
	// of the image.
	UseEphemeralStorage      bool   `toml:"use_ephemeral_storage"`
	VirtualNetworkCIDR       string `toml:"virtual_network_cidr"`
	UseAcceleratedNetworking bool   `toml:"use_accelerated_networking"`
	VnetSubnetID             string `toml:"vnet_subnet_id"`
	DisableIsolatedNetworks  bool   `toml:"disable_isolated_networks"`
}

func NewConfig

func NewConfig(cfgFile string) (*Config, error)

NewConfig returns a new Config

func (*Config) Validate

func (c *Config) Validate() error

type Credentials

type Credentials struct {
	SubscriptionID   string                      `toml:"subscription_id"`
	SPCredentials    ServicePrincipalCredentials `toml:"service_principal"`
	WorkloadIdentity WorkloadIdentityCredentials `toml:"workload_identity"`
	ManagedIdentity  ManagedIdentityCredentials  `toml:"managed_identity"`
	// ClientOptions is the azure identity client options that will be used to authenticate
	// against an azure cloud. This is a heavy handed approach for now, defining the entire
	// ClientOptions here, but should allow users to use this provider with AzureStack or any
	// other azure cloud besides Azure proper (like Azure China, Germany, etc).
	ClientOptions azcore.ClientOptions `toml:"client_options"`
}

func (Credentials) GetCredentials

func (c Credentials) GetCredentials() (azcore.TokenCredential, error)

func (Credentials) Validate

func (c Credentials) Validate() error

type ManagedIdentityCredentials

type ManagedIdentityCredentials struct {
	ClientID string `toml:"client_id"`
}

type ServicePrincipalCredentials

type ServicePrincipalCredentials struct {
	TenantID     string `toml:"tenant_id"`
	ClientID     string `toml:"client_id"`
	ClientSecret string `toml:"client_secret"`
}

func (ServicePrincipalCredentials) Auth

func (ServicePrincipalCredentials) Validate

func (c ServicePrincipalCredentials) Validate() error

type WorkloadIdentityCredentials added in v0.1.2

type WorkloadIdentityCredentials struct {
	TenantID           string `toml:"tenant_id"`
	ClientID           string `toml:"client_id"`
	FederatedTokenFile string `toml:"federated_token_file"`
}

Jump to

Keyboard shortcuts

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