Documentation ¶
Overview ¶
Package infra implements utilities to interact with a Pulumi infrastructure
Package infra implements utilities to interact with a Pulumi infrastructure ¶
Package infra implements utilities to interact with a Pulumi infrastructure
Index ¶
- type GetStackOption
- func WithCancelTimeout(cancelTimeout time.Duration) GetStackOption
- func WithConfigMap(config runner.ConfigMap) GetStackOption
- func WithDatadogEventSender(datadogEventSender datadogEventSender) GetStackOption
- func WithDestroyTimeout(destroyTimeout time.Duration) GetStackOption
- func WithFailOnMissing(failOnMissing bool) GetStackOption
- func WithLogWriter(logWriter io.Writer) GetStackOption
- func WithUpTimeout(upTimeout time.Duration) GetStackOption
- type RetryStrategy
- type RetryType
- type StackManager
- func (sm *StackManager) Cleanup(ctx context.Context) []error
- func (sm *StackManager) DeleteStack(ctx context.Context, name string, logWriter io.Writer) (err error)
- func (sm *StackManager) ForceRemoveStackConfiguration(ctx context.Context, name string) (err error)
- func (sm *StackManager) GetPulumiStackName(name string) (_ string, err error)
- func (sm *StackManager) GetStack(ctx context.Context, name string, config runner.ConfigMap, ...) (_ *auto.Stack, _ auto.UpResult, err error)
- func (sm *StackManager) GetStackNoDeleteOnFailure(ctx context.Context, name string, deployFunc pulumi.RunFunc, ...) (_ *auto.Stack, _ auto.UpResult, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetStackOption ¶ added in v0.56.0
type GetStackOption func(*getStackParams)
GetStackOption is a function that sets a parameter for GetStack function
func WithCancelTimeout ¶ added in v0.56.0
func WithCancelTimeout(cancelTimeout time.Duration) GetStackOption
WithCancelTimeout sets the cancel timeout for the stack
func WithConfigMap ¶ added in v0.56.0
func WithConfigMap(config runner.ConfigMap) GetStackOption
WithConfigMap sets the configuration map for the stack
func WithDatadogEventSender ¶ added in v0.56.0
func WithDatadogEventSender(datadogEventSender datadogEventSender) GetStackOption
WithDatadogEventSender sets the datadog event sender for the stack
func WithDestroyTimeout ¶ added in v0.56.0
func WithDestroyTimeout(destroyTimeout time.Duration) GetStackOption
WithDestroyTimeout sets the destroy timeout for the stack
func WithFailOnMissing ¶ added in v0.56.0
func WithFailOnMissing(failOnMissing bool) GetStackOption
WithFailOnMissing sets the failOnMissing flag for the stack
func WithLogWriter ¶ added in v0.56.0
func WithLogWriter(logWriter io.Writer) GetStackOption
WithLogWriter sets the log writer for the stack
func WithUpTimeout ¶ added in v0.56.0
func WithUpTimeout(upTimeout time.Duration) GetStackOption
WithUpTimeout sets the up timeout for the stack
type RetryStrategy ¶ added in v0.58.0
type RetryStrategy func(error, int) (RetryType, []GetStackOption)
RetryStrategy is a function that given the current error and the number of retries, returns the type of retry to perform and a list of options to modify the configuration
type RetryType ¶ added in v0.58.0
type RetryType string
RetryType is an enum to specify the type of retry to perform
type StackManager ¶
type StackManager struct { // RetryStrategy defines how to handle retries. By default points to StackManager.getRetryStrategyFrom but can be overridden RetryStrategy RetryStrategy // 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 ¶
func (sm *StackManager) DeleteStack(ctx context.Context, name string, logWriter io.Writer) (err error)
DeleteStack safely deletes a stack
func (*StackManager) ForceRemoveStackConfiguration ¶
func (sm *StackManager) ForceRemoveStackConfiguration(ctx context.Context, name string) (err 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, err 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, err 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, deployFunc pulumi.RunFunc, options ...GetStackOption) (_ *auto.Stack, _ auto.UpResult, err 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.