azureconfig

package
v0.14.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AzureSubdomain = "azure"
	CloudName      = "LocalStack"
)
View Source
const PublicCloudName = "AzureCloud"

PublicCloudName is the built-in Azure CLI cloud for public Azure. It is always registered, so it is the safe default to switch back to when stopping interception.

Variables

This section is empty.

Functions

func ActiveCloud added in v0.14.0

func ActiveCloud(ctx context.Context, azEnv []string) (string, error)

ActiveCloud returns the name of the currently active Azure CLI cloud.

func BuildCloudConfig

func BuildCloudConfig(endpointURL string) (string, error)

BuildCloudConfig returns the JSON payload for `az cloud register/update --cloud-config`.

func BuildEndpoint

func BuildEndpoint(host string) string

func ConfigDir

func ConfigDir(lstkConfigDir string) string

func Env

func Env(azureConfigDir string) []string

func IsHealthy

func IsHealthy(ctx context.Context, endpointURL string) error

func IsSetUp

func IsSetUp(azureConfigDir string) bool

func ListClouds added in v0.14.0

func ListClouds(ctx context.Context, azEnv []string) ([]string, error)

ListClouds returns the names of all clouds registered in the Azure CLI config selected by azEnv (built-ins like AzureCloud plus any custom-registered clouds).

func RunSetup

func RunSetup(ctx context.Context, sink output.Sink, containers []config.ContainerConfig, localStackHost, lstkConfigDir string) error

RunSetup derives the LocalStack Azure endpoint from the configured containers and runs Setup against the isolated Azure CLI config dir under lstkConfigDir. It works with any sink, so it serves both the interactive (TUI) and non-interactive (plain) paths.

func Setup

func Setup(ctx context.Context, sink output.Sink, endpointURL, azureConfigDir string) error

Setup registers the LocalStack custom cloud in an isolated AZURE_CONFIG_DIR, activates it, disables instance discovery, and logs in with a dummy SP.

func StartInterception added in v0.14.0

func StartInterception(ctx context.Context, sink output.Sink, endpointURL string) error

StartInterception registers and activates the LocalStack custom cloud in the user's global Azure CLI config (default ~/.azure — no AZURE_CONFIG_DIR override), so plain `az` commands in any terminal target the LocalStack Azure emulator until StopInterception is run. Unlike Setup, it does not touch the isolated `lstk az` config. The caller is expected to have verified the Azure CLI is installed (see azPreflight).

func StopInterception added in v0.14.0

func StopInterception(ctx context.Context, sink output.Sink, targetCloud string) error

StopInterception switches the global active Azure CLI cloud away from LocalStack back to targetCloud (defaulting to AzureCloud) and re-enables instance discovery. As a guard against clobbering an unrelated selection, it only changes the active cloud when LocalStack is currently active; otherwise it reports the current cloud and does nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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