cli/azd/pkg/infra/provisioning/provider.go (44 lines of code) (raw):
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package provisioning
import (
"context"
)
type ProviderKind string
const (
NotSpecified ProviderKind = ""
Bicep ProviderKind = "bicep"
Arm ProviderKind = "arm"
Terraform ProviderKind = "terraform"
Pulumi ProviderKind = "pulumi"
Test ProviderKind = "test"
)
type Options struct {
Provider ProviderKind `yaml:"provider,omitempty"`
Path string `yaml:"path,omitempty"`
Module string `yaml:"module,omitempty"`
DeploymentStacks map[string]any `yaml:"deploymentStacks,omitempty"`
// Not expected to be defined at azure.yaml
IgnoreDeploymentState bool `yaml:"-"`
}
type SkippedReasonType string
const DeploymentStateSkipped SkippedReasonType = "deployment State"
type DeployResult struct {
Deployment *Deployment
SkippedReason SkippedReasonType
}
// DeployPreviewResult defines one deployment in preview mode, displaying what changes would it be performed, without
// applying the changes.
type DeployPreviewResult struct {
Preview *DeploymentPreview
}
type DestroyResult struct {
// InvalidatedEnvKeys is a list of keys that should be removed from the environment after the destroy is complete.
InvalidatedEnvKeys []string
}
type StateResult struct {
State *State
}
type Provider interface {
Name() string
Initialize(ctx context.Context, projectPath string, options Options) error
State(ctx context.Context, options *StateOptions) (*StateResult, error)
Deploy(ctx context.Context) (*DeployResult, error)
Preview(ctx context.Context) (*DeployPreviewResult, error)
Destroy(ctx context.Context, options DestroyOptions) (*DestroyResult, error)
EnsureEnv(ctx context.Context) error
}