Documentation ¶
Overview ¶
Package infra implements utilities to interact with a Pulumi infrastructure
Index ¶
- type StackManager
- func (sm *StackManager) Cleanup(ctx context.Context) []error
- func (sm *StackManager) DeleteStack(ctx context.Context, name string, logWriter io.Writer) error
- func (sm *StackManager) ForceRemoveStackConfiguration(ctx context.Context, name string) error
- func (sm *StackManager) GetPulumiStackName(name string) (string, error)
- func (sm *StackManager) GetStack(ctx context.Context, name string, config runner.ConfigMap, ...) (*auto.Stack, auto.UpResult, error)
- func (sm *StackManager) GetStackNoDeleteOnFailure(ctx context.Context, name string, config runner.ConfigMap, ...) (*auto.Stack, auto.UpResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StackManager ¶
type StackManager struct {
// contains filtered or unexported fields
}
StackManager handles
func GetStackManager ¶
func GetStackManager() *StackManager
GetStackManager returns a stack manager, initialising on first call
func (*StackManager) Cleanup ¶
func (sm *StackManager) Cleanup(ctx context.Context) []error
Cleanup delete any existing stack
func (*StackManager) DeleteStack ¶
DeleteStack safely deletes a stack
func (*StackManager) ForceRemoveStackConfiguration ¶
func (sm *StackManager) ForceRemoveStackConfiguration(ctx context.Context, name string) error
ForceRemoveStackConfiguration removes the configuration files pulumi creates for managing a stack. It DOES NOT perform any cleanup of the resources created by the stack. Call `DeleteStack` for correct cleanup.
func (*StackManager) GetPulumiStackName ¶ added in v0.50.0
func (sm *StackManager) GetPulumiStackName(name string) (string, error)
GetPulumiStackName returns the Pulumi stack name The internal Pulumi stack name should normally remain hidden as all the Pulumi interactions should be done via the StackManager. The only use case for getting the internal Pulumi stack name is to interact directly with Pulumi for debug purposes.
func (*StackManager) GetStack ¶
func (sm *StackManager) GetStack(ctx context.Context, name string, config runner.ConfigMap, deployFunc pulumi.RunFunc, failOnMissing bool) (*auto.Stack, auto.UpResult, error)
GetStack creates or return a stack based on stack name and config, if error occurs during stack creation it destroy all the resources created
func (*StackManager) GetStackNoDeleteOnFailure ¶
func (sm *StackManager) GetStackNoDeleteOnFailure(ctx context.Context, name string, config runner.ConfigMap, deployFunc pulumi.RunFunc, failOnMissing bool, logWriter io.Writer) (*auto.Stack, auto.UpResult, error)
GetStackNoDeleteOnFailure creates or return a stack based on stack name and config, if error occurs during stack creation, it will not destroy the created resources. Using this can lead to resource leaks.