Documentation ¶
Index ¶
- Variables
- func EnsureSubscriptionAndLocation(ctx context.Context, envManager environment.Manager, ...) error
- func NewEnvRefreshResultFromState(state *State) contracts.EnvRefreshResult
- type ActionOptions
- type ChangeType
- type CurrentPrincipalIdProvider
- type DefaultProviderResolver
- type DeployPreviewResult
- type DeployResult
- type Deployment
- type DeploymentPreview
- type DeploymentPreviewChange
- type DeploymentPreviewProperties
- type DeploymentPreviewPropertyChange
- type DestroyOptions
- type DestroyResult
- type InputParameter
- type Manager
- func (m *Manager) Deploy(ctx context.Context) (*DeployResult, error)
- func (m *Manager) Destroy(ctx context.Context, options DestroyOptions) (*DestroyResult, error)
- func (m *Manager) Initialize(ctx context.Context, projectPath string, options Options) error
- func (m *Manager) Preview(ctx context.Context) (*DeployPreviewResult, error)
- func (m *Manager) State(ctx context.Context, options *StateOptions) (*StateResult, error)
- func (m *Manager) UpdateEnvironment(ctx context.Context, outputs map[string]OutputParameter) error
- type Options
- type OutputParameter
- type ParameterType
- type PropertyChangeType
- type Provider
- type ProviderKind
- type Resource
- type SkippedReasonType
- type State
- type StateOptions
- type StateResult
Constants ¶
This section is empty.
Variables ¶
var AzdOperationsFeatureKey = alpha.MustFeatureKey("azd.operations")
var ErrAzdOperationsNotEnabled = fmt.Errorf( "azd operations (alpha feature) is required but disabled. You can enable azd operations by running: %s", output.WithGrayFormat("%s", alpha.GetEnableCommand(AzdOperationsFeatureKey)))
var ErrBindMountOperationDisabled = fmt.Errorf( "%sYour project has bind mounts.\n - %w\n%s\n", output.WithWarningFormat("*Note: "), ErrAzdOperationsNotEnabled, output.WithWarningFormat("Ignoring bind mounts."), )
Functions ¶
func EnsureSubscriptionAndLocation ¶
func EnsureSubscriptionAndLocation( ctx context.Context, envManager environment.Manager, env *environment.Environment, prompter prompt.Prompter, locationFiler prompt.LocationFilterPredicate, ) error
EnsureSubscriptionAndLocation ensures that that that subscription (AZURE_SUBSCRIPTION_ID) and location (AZURE_LOCATION) variables are set in the environment, prompting the user for the values if they do not exist. locationFilter, when non-nil, filters the locations being displayed.
func NewEnvRefreshResultFromState ¶
func NewEnvRefreshResultFromState(state *State) contracts.EnvRefreshResult
NewEnvRefreshResultFromState creates a EnvRefreshResult from a provisioning state object, applying the required translations.
Types ¶
type ActionOptions ¶
type ActionOptions struct {
// contains filtered or unexported fields
}
func NewActionOptions ¶
func NewActionOptions(formatter output.Formatter, interactive bool) ActionOptions
func (*ActionOptions) Formatter ¶
func (options *ActionOptions) Formatter() output.Formatter
Gets the specified output format
func (*ActionOptions) IsInteractive ¶
func (options *ActionOptions) IsInteractive() bool
Gets a value determining whether the console is interactive Console is only considered interactive when the interactive flag has been set and an output format has not been defined.
type ChangeType ¶
type ChangeType string
ChangeType defines a type for the valid changes for an Azure resource.
const ( ChangeTypeCreate ChangeType = "Create" ChangeTypeDelete ChangeType = "Delete" ChangeTypeDeploy ChangeType = "Deploy" ChangeTypeIgnore ChangeType = "Ignore" ChangeTypeModify ChangeType = "Modify" ChangeTypeNoChange ChangeType = "NoChange" ChangeTypeUnsupported ChangeType = "Unsupported" )
type CurrentPrincipalIdProvider ¶
type CurrentPrincipalIdProvider interface { // CurrentPrincipalId returns the object id of the current logged in principal, or an error if it can not be // determined. CurrentPrincipalId(ctx context.Context) (string, error) }
func NewPrincipalIdProvider ¶
func NewPrincipalIdProvider( env *environment.Environment, userProfileService *azapi.UserProfileService, subResolver account.SubscriptionTenantResolver, ) CurrentPrincipalIdProvider
type DefaultProviderResolver ¶
type DefaultProviderResolver func() (ProviderKind, error)
type DeployPreviewResult ¶
type DeployPreviewResult struct {
Preview *DeploymentPreview
}
DeployPreviewResult defines one deployment in preview mode, displaying what changes would it be performed, without applying the changes.
type DeployResult ¶
type DeployResult struct { Deployment *Deployment SkippedReason SkippedReasonType }
type Deployment ¶
type Deployment struct { Parameters map[string]InputParameter Outputs map[string]OutputParameter }
type DeploymentPreview ¶
type DeploymentPreview struct { Status string Properties *DeploymentPreviewProperties }
DeploymentPreview defines the general structure for a deployment preview regardless of the deployment provider.
type DeploymentPreviewChange ¶
type DeploymentPreviewChange struct { ChangeType ChangeType ResourceId Resource ResourceType string Name string UnsupportedReason string Before interface{} After interface{} Delta []DeploymentPreviewPropertyChange }
DeploymentPreviewChange represents a change to one Azure resource.
type DeploymentPreviewProperties ¶
type DeploymentPreviewProperties struct {
Changes []*DeploymentPreviewChange
}
DeploymentPreviewProperties holds the changes for the deployment preview.
type DeploymentPreviewPropertyChange ¶
type DeploymentPreviewPropertyChange struct { ChangeType PropertyChangeType Path string Before interface{} After interface{} Children []DeploymentPreviewPropertyChange }
DeploymentPreviewPropertyChange includes the details and properties from a resource change.
type DestroyOptions ¶
type DestroyOptions struct {
// contains filtered or unexported fields
}
Infrastructure destroy options
func NewDestroyOptions ¶
func NewDestroyOptions(force bool, purge bool) DestroyOptions
func (*DestroyOptions) Force ¶
func (o *DestroyOptions) Force() bool
func (*DestroyOptions) Purge ¶
func (o *DestroyOptions) Purge() bool
type DestroyResult ¶
type DestroyResult struct { // InvalidatedEnvKeys is a list of keys that should be removed from the environment after the destroy is complete. InvalidatedEnvKeys []string }
type InputParameter ¶
type InputParameter struct { Type string DefaultValue interface{} Value interface{} }
func (*InputParameter) HasDefaultValue ¶
func (p *InputParameter) HasDefaultValue() bool
func (*InputParameter) HasValue ¶
func (p *InputParameter) HasValue() bool
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manages the orchestration of infrastructure provisioning
func NewManager ¶
func NewManager( serviceLocator ioc.ServiceLocator, defaultProvider DefaultProviderResolver, envManager environment.Manager, env *environment.Environment, console input.Console, alphaFeatureManager *alpha.FeatureManager, fileShareService storage.FileShareService, cloud *cloud.Cloud, ) *Manager
Creates a new instance of the Provisioning Manager
func (*Manager) Deploy ¶
func (m *Manager) Deploy(ctx context.Context) (*DeployResult, error)
Deploys the Azure infrastructure for the specified project
func (*Manager) Destroy ¶
func (m *Manager) Destroy(ctx context.Context, options DestroyOptions) (*DestroyResult, error)
Destroys the Azure infrastructure for the specified project
func (*Manager) Initialize ¶
func (*Manager) Preview ¶
func (m *Manager) Preview(ctx context.Context) (*DeployPreviewResult, error)
Preview generates the list of changes to be applied as part of the provisioning.
func (*Manager) State ¶
func (m *Manager) State(ctx context.Context, options *StateOptions) (*StateResult, error)
Gets the latest deployment details for the specified scope
func (*Manager) UpdateEnvironment ¶
type OutputParameter ¶
type OutputParameter struct { Type ParameterType Value interface{} }
type ParameterType ¶
type ParameterType string
const ( ParameterTypeString ParameterType = "string" ParameterTypeNumber ParameterType = "number" ParameterTypeBoolean ParameterType = "bool" ParameterTypeObject ParameterType = "object" ParameterTypeArray ParameterType = "array" )
type PropertyChangeType ¶
type PropertyChangeType string
PropertyChangeType defines a type for the valid properties of a change.
const ( PropertyChangeTypeArray PropertyChangeType = "Array" PropertyChangeTypeCreate PropertyChangeType = "Create" PropertyChangeTypeDelete PropertyChangeType = "Delete" PropertyChangeTypeModify PropertyChangeType = "Modify" PropertyChangeTypeNoEffect PropertyChangeType = "NoEffect" )
type Provider ¶
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 }
type ProviderKind ¶
type ProviderKind string
const ( NotSpecified ProviderKind = "" Bicep ProviderKind = "bicep" Arm ProviderKind = "arm" Terraform ProviderKind = "terraform" Pulumi ProviderKind = "pulumi" Test ProviderKind = "test" )
func ParseProvider ¶
func ParseProvider(kind ProviderKind) (ProviderKind, error)
Parses the specified IaC Provider to ensure whether it is valid or not Defaults to `Bicep` if no provider is specified
type SkippedReasonType ¶
type SkippedReasonType string
const DeploymentStateSkipped SkippedReasonType = "deployment State"
type State ¶
type State struct { // Outputs from the most recent deployment. Outputs map[string]OutputParameter // The resources that make up the application. Resources []Resource }
State represents the "current state" of the infrastructure, which is the result of the most recent deployment. For ARM this corresponds to information from the most recent deployment object. For Terraform, it's information from the state file.
type StateOptions ¶
type StateOptions struct {
// contains filtered or unexported fields
}
func NewStateOptions ¶
func NewStateOptions(hint string) *StateOptions
func (*StateOptions) Hint ¶
func (o *StateOptions) Hint() string
type StateResult ¶
type StateResult struct {
State *State
}