Documentation
¶
Index ¶
- Variables
- func NewBicepProvider(azapi *azapi.AzureClient, bicepCli *bicep.Cli, ...) provisioning.Provider
- type BicepProvider
- func (p *BicepProvider) Deploy(ctx context.Context) (*provisioning.DeployResult, error)
- func (p *BicepProvider) Destroy(ctx context.Context, options provisioning.DestroyOptions) (*provisioning.DestroyResult, error)
- func (p *BicepProvider) EnsureEnv(ctx context.Context) error
- func (p *BicepProvider) Initialize(ctx context.Context, projectPath string, opt provisioning.Options) error
- func (p *BicepProvider) LastDeployment(ctx context.Context) (*azapi.ResourceDeployment, error)
- func (p *BicepProvider) Name() string
- func (p *BicepProvider) Parameters(ctx context.Context) ([]provisioning.Parameter, error)
- func (p *BicepProvider) PlannedOutputs(ctx context.Context) ([]provisioning.PlannedOutput, error)
- func (p *BicepProvider) Preview(ctx context.Context) (*provisioning.DeployPreviewResult, error)
- func (p *BicepProvider) State(ctx context.Context, options *provisioning.StateOptions) (*provisioning.StateResult, error)
- type InputConstraints
- type MissingInput
- type MissingInputsError
- type PreflightCheck
- type PreflightCheckFn
- type PreflightCheckResult
- type PreflightCheckSeverity
Constants ¶
This section is empty.
Variables ¶
var ErrEnsureEnvPreReqBicepCompileFailed = errors.New("")
Functions ¶
func NewBicepProvider ¶
func NewBicepProvider( azapi *azapi.AzureClient, bicepCli *bicep.Cli, resourceService *azapi.ResourceService, resourceManager infra.ResourceManager, deploymentManager *infra.DeploymentManager, envManager environment.Manager, env *environment.Environment, console input.Console, prompters prompt.Prompter, curPrincipal provisioning.CurrentPrincipalIdProvider, keyvaultService keyvault.KeyVaultService, cloud *cloud.Cloud, subscriptionManager *account.SubscriptionsManager, aiModelService *ai.AiModelService, serviceLocator ioc.ServiceLocator, ) provisioning.Provider
NewBicepProvider creates a new instance of a Bicep Infra provider
Types ¶
type BicepProvider ¶
type BicepProvider struct {
// contains filtered or unexported fields
}
BicepProvider exposes infrastructure provisioning using Azure Bicep templates
func (*BicepProvider) Deploy ¶
func (p *BicepProvider) Deploy(ctx context.Context) (*provisioning.DeployResult, error)
Provisioning the infrastructure within the specified template
func (*BicepProvider) Destroy ¶
func (p *BicepProvider) Destroy( ctx context.Context, options provisioning.DestroyOptions, ) (*provisioning.DestroyResult, error)
Destroys the specified deployment by deleting all azure resources, resource groups & deployments that are referenced.
func (*BicepProvider) EnsureEnv ¶
func (p *BicepProvider) EnsureEnv(ctx context.Context) error
EnsureEnv ensures that the environment is in a provision-ready state with required values set, prompting the user if values are unset. This also requires that the Bicep module can be compiled.
func (*BicepProvider) Initialize ¶
func (p *BicepProvider) Initialize(ctx context.Context, projectPath string, opt provisioning.Options) error
Initialize initializes provider state from the options. It also calls EnsureEnv, which ensures the client-side state is ready for provisioning.
func (*BicepProvider) LastDeployment ¶
func (p *BicepProvider) LastDeployment(ctx context.Context) (*azapi.ResourceDeployment, error)
func (*BicepProvider) Name ¶
func (p *BicepProvider) Name() string
Name gets the name of the infra provider
func (*BicepProvider) Parameters ¶
func (p *BicepProvider) Parameters(ctx context.Context) ([]provisioning.Parameter, error)
func (*BicepProvider) PlannedOutputs ¶ added in v1.23.14
func (p *BicepProvider) PlannedOutputs(ctx context.Context) ([]provisioning.PlannedOutput, error)
func (*BicepProvider) Preview ¶
func (p *BicepProvider) Preview(ctx context.Context) (*provisioning.DeployPreviewResult, error)
Preview runs deploy using the what-if argument
func (*BicepProvider) State ¶
func (p *BicepProvider) State(ctx context.Context, options *provisioning.StateOptions) (*provisioning.StateResult, error)
type InputConstraints ¶
type InputConstraints struct {
MinLength *int `json:"minLength,omitempty"`
MaxLength *int `json:"maxLength,omitempty"`
MinValue *int `json:"minValue,omitempty"`
MaxValue *int `json:"maxValue,omitempty"`
}
InputConstraints captures the numeric/length constraints from an ARM parameter definition.
type MissingInput ¶
type MissingInput struct {
Name string `json:"name"`
Type string `json:"type"`
Secure bool `json:"secure"`
Description string `json:"description,omitempty"`
EnvVarNames []string `json:"envVarNames,omitempty"`
ConfigKey string `json:"configKey,omitempty"`
AllowedValues []string `json:"allowedValues,omitempty"`
Constraints *InputConstraints `json:"constraints,omitempty"`
}
MissingInput represents a missing required input for infrastructure provisioning.
type MissingInputsError ¶
type MissingInputsError struct {
Inputs []MissingInput
}
MissingInputsError is an error that contains information about all missing required inputs.
func (*MissingInputsError) Error ¶
func (e *MissingInputsError) Error() string
Error implements the error interface for MissingInputsError.
func (*MissingInputsError) MarshalJSON ¶
func (e *MissingInputsError) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for MissingInputsError.
func (*MissingInputsError) ToString ¶
func (e *MissingInputsError) ToString(currentIndentation string) string
ToString returns a formatted message with the missing inputs and resolution guidance.
type PreflightCheck ¶ added in v1.23.14
type PreflightCheck struct {
// RuleID is a unique, stable identifier for the rule (e.g. "role_assignment_permissions").
RuleID string
// Fn is the check function that performs the validation.
Fn PreflightCheckFn
}
PreflightCheck pairs a unique rule identifier with its check function. The RuleID is a stable, unique string used in telemetry to identify which rule produced a result (e.g. for crash tracking). Each rule may emit results with different DiagnosticIDs to distinguish specific finding types.
type PreflightCheckFn ¶
type PreflightCheckFn func( ctx context.Context, valCtx *validationContext, ) ([]PreflightCheckResult, error)
PreflightCheckFn is a function that performs a single preflight validation check. It receives the execution context and a validationContext containing the console, analyzed resource properties, and the deployment snapshot. It returns zero or more results describing findings (or nil/empty if there is nothing to report) and an error if the check itself failed to execute.
type PreflightCheckResult ¶
type PreflightCheckResult struct {
// Severity indicates whether this result is a warning or a blocking error.
Severity PreflightCheckSeverity
// DiagnosticID is a unique, stable identifier for this specific finding type
// (e.g. "role_assignment_missing"). Used in telemetry to correlate actioned
// warnings with deployment outcomes and to track error frequency over time.
DiagnosticID string
// Message is a human-readable description of the finding.
Message string
}
PreflightCheckResult holds the outcome of a single preflight check function.
type PreflightCheckSeverity ¶
type PreflightCheckSeverity int
PreflightCheckSeverity indicates the severity level of a preflight check result.
const ( // PreflightCheckWarning indicates a non-blocking issue that should be reported to the user. PreflightCheckWarning PreflightCheckSeverity = iota // PreflightCheckError indicates a blocking issue that should prevent deployment. PreflightCheckError )