stratus

package
v0.0.0-...-dfc44ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchesChangeSetContents

func MatchesChangeSetContents(
	stack *config.Stack,
	changeSet *cloudformation.DescribeChangeSetOutput,
	template *cloudformation.GetTemplateOutput,
) bool

func MatchesChangeSetSummary

func MatchesChangeSetSummary(
	stack *config.Stack,
	summary *cloudformation.ChangeSetSummary,
) bool

Types

type ChangeSetType

type ChangeSetType int
const (
	ChangeSetTypeCreate ChangeSetType
	ChangeSetTypeUpdate
)

func ParseChangeSetType

func ParseChangeSetType(raw string) (changeSetType ChangeSetType, ok bool)

func (ChangeSetType) String

func (changeSetType ChangeSetType) String() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfn CloudFormation, s3 S3) *Client

func (*Client) CreateChangeSet

func (client *Client) CreateChangeSet(
	ctx context.Context,
	stack *config.Stack,
) (_ *cloudformation.DescribeChangeSetOutput, err error)

func (*Client) DeleteStack

func (client *Client) DeleteStack(
	ctx context.Context,
	stack *config.Stack,
) error

func (*Client) DescribeOutputs

func (client *Client) DescribeOutputs(
	ctx context.Context,
	stack *config.Stack,
) ([]*cloudformation.Output, error)

func (*Client) Diff

func (client *Client) Diff(
	ctx context.Context,
	stack *config.Stack,
	describeOutput *cloudformation.DescribeChangeSetOutput,
) (*Diff, error)

func (*Client) ExecuteChangeSet

func (client *Client) ExecuteChangeSet(
	ctx context.Context,
	stack *config.Stack,
	name string,
) error

func (*Client) FindExistingChangeSet

func (client *Client) FindExistingChangeSet(
	ctx context.Context,
	stack *config.Stack,
) (*cloudformation.DescribeChangeSetOutput, error)

func (*Client) SetStackPolicy

func (client *Client) SetStackPolicy(
	ctx context.Context,
	stack *config.Stack,
) error

func (*Client) UpdateTerminationProtection

func (client *Client) UpdateTerminationProtection(
	ctx context.Context,
	stack *config.Stack,
) error

func (*Client) UploadArtefacts

func (client *Client) UploadArtefacts(
	ctx context.Context,
	stack *config.Stack,
) error

func (*Client) ValidateTemplate

func (client *Client) ValidateTemplate(
	ctx context.Context,
	stack *config.Stack,
) (*cloudformation.ValidateTemplateOutput, error)

type CloudFormation

type CloudFormation interface {
	CreateChangeSetWithContext(
		aws.Context,
		*cloudformation.CreateChangeSetInput,
		...request.Option,
	) (*cloudformation.CreateChangeSetOutput, error)

	DeleteStackWithContext(
		aws.Context,
		*cloudformation.DeleteStackInput,
		...request.Option,
	) (*cloudformation.DeleteStackOutput, error)

	DescribeChangeSetWithContext(
		aws.Context,
		*cloudformation.DescribeChangeSetInput,
		...request.Option,
	) (*cloudformation.DescribeChangeSetOutput, error)

	DescribeStackEventsWithContext(
		aws.Context,
		*cloudformation.DescribeStackEventsInput,
		...request.Option,
	) (*cloudformation.DescribeStackEventsOutput, error)

	DescribeStacksWithContext(
		aws.Context,
		*cloudformation.DescribeStacksInput,
		...request.Option,
	) (*cloudformation.DescribeStacksOutput, error)

	ExecuteChangeSetWithContext(
		aws.Context,
		*cloudformation.ExecuteChangeSetInput,
		...request.Option,
	) (*cloudformation.ExecuteChangeSetOutput, error)

	GetStackPolicyWithContext(
		aws.Context,
		*cloudformation.GetStackPolicyInput,
		...request.Option,
	) (*cloudformation.GetStackPolicyOutput, error)

	GetTemplateWithContext(
		aws.Context,
		*cloudformation.GetTemplateInput,
		...request.Option,
	) (*cloudformation.GetTemplateOutput, error)

	ListChangeSetsWithContext(
		aws.Context,
		*cloudformation.ListChangeSetsInput,
		...request.Option,
	) (*cloudformation.ListChangeSetsOutput, error)

	SetStackPolicyWithContext(
		aws.Context,
		*cloudformation.SetStackPolicyInput,
		...request.Option,
	) (*cloudformation.SetStackPolicyOutput, error)

	UpdateTerminationProtectionWithContext(
		aws.Context,
		*cloudformation.UpdateTerminationProtectionInput,
		...request.Option,
	) (*cloudformation.UpdateTerminationProtectionOutput, error)

	WaitUntilChangeSetCreateCompleteWithContext(
		aws.Context,
		*cloudformation.DescribeChangeSetInput,
		...request.WaiterOption,
	) error

	WaitUntilStackCreateCompleteWithContext(
		aws.Context,
		*cloudformation.DescribeStacksInput,
		...request.WaiterOption,
	) error

	WaitUntilStackDeleteCompleteWithContext(
		aws.Context,
		*cloudformation.DescribeStacksInput,
		...request.WaiterOption,
	) error

	WaitUntilStackUpdateCompleteWithContext(
		aws.Context,
		*cloudformation.DescribeStacksInput,
		...request.WaiterOption,
	) error

	ValidateTemplateWithContext(
		aws.Context,
		*cloudformation.ValidateTemplateInput,
		...request.Option,
	) (*cloudformation.ValidateTemplateOutput, error)
}

type CloudFormationMock

type CloudFormationMock struct {
	mock.Mock
}

func NewCloudFormationMock

func NewCloudFormationMock() *CloudFormationMock

func (*CloudFormationMock) CreateChangeSetWithContext

func (client *CloudFormationMock) CreateChangeSetWithContext(
	_ aws.Context,
	input *cloudformation.CreateChangeSetInput,
	_ ...request.Option,
) (*cloudformation.CreateChangeSetOutput, error)

func (*CloudFormationMock) DeleteStackWithContext

func (client *CloudFormationMock) DeleteStackWithContext(
	_ aws.Context,
	input *cloudformation.DeleteStackInput,
	_ ...request.Option,
) (*cloudformation.DeleteStackOutput, error)

func (*CloudFormationMock) DescribeChangeSetWithContext

func (*CloudFormationMock) DescribeStackEventsWithContext

func (*CloudFormationMock) DescribeStacksWithContext

func (client *CloudFormationMock) DescribeStacksWithContext(
	_ aws.Context,
	input *cloudformation.DescribeStacksInput,
	_ ...request.Option,
) (*cloudformation.DescribeStacksOutput, error)

func (*CloudFormationMock) ExecuteChangeSetWithContext

func (client *CloudFormationMock) ExecuteChangeSetWithContext(
	_ aws.Context,
	input *cloudformation.ExecuteChangeSetInput,
	_ ...request.Option,
) (*cloudformation.ExecuteChangeSetOutput, error)

func (*CloudFormationMock) GetStackPolicyWithContext

func (client *CloudFormationMock) GetStackPolicyWithContext(
	_ aws.Context,
	input *cloudformation.GetStackPolicyInput,
	_ ...request.Option,
) (*cloudformation.GetStackPolicyOutput, error)

func (*CloudFormationMock) GetTemplateWithContext

func (client *CloudFormationMock) GetTemplateWithContext(
	_ aws.Context,
	input *cloudformation.GetTemplateInput,
	_ ...request.Option,
) (*cloudformation.GetTemplateOutput, error)

func (*CloudFormationMock) ListChangeSetsWithContext

func (client *CloudFormationMock) ListChangeSetsWithContext(
	_ aws.Context,
	input *cloudformation.ListChangeSetsInput,
	_ ...request.Option,
) (*cloudformation.ListChangeSetsOutput, error)

func (*CloudFormationMock) SetStackPolicyWithContext

func (client *CloudFormationMock) SetStackPolicyWithContext(
	_ aws.Context,
	input *cloudformation.SetStackPolicyInput,
	_ ...request.Option,
) (*cloudformation.SetStackPolicyOutput, error)

func (*CloudFormationMock) ValidateTemplateWithContext

func (client *CloudFormationMock) ValidateTemplateWithContext(
	_ aws.Context,
	input *cloudformation.ValidateTemplateInput,
	_ ...request.Option,
) (*cloudformation.ValidateTemplateOutput, error)

func (*CloudFormationMock) WaitUntilChangeSetCreateCompleteWithContext

func (client *CloudFormationMock) WaitUntilChangeSetCreateCompleteWithContext(
	_ aws.Context,
	input *cloudformation.DescribeChangeSetInput,
	_ ...request.WaiterOption,
) error

func (*CloudFormationMock) WaitUntilStackCreateCompleteWithContext

func (client *CloudFormationMock) WaitUntilStackCreateCompleteWithContext(
	_ aws.Context,
	input *cloudformation.DescribeStacksInput,
	_ ...request.WaiterOption,
) error

func (*CloudFormationMock) WaitUntilStackDeleteCompleteWithContext

func (client *CloudFormationMock) WaitUntilStackDeleteCompleteWithContext(
	_ aws.Context,
	input *cloudformation.DescribeStacksInput,
	_ ...request.WaiterOption,
) error

func (*CloudFormationMock) WaitUntilStackUpdateCompleteWithContext

func (client *CloudFormationMock) WaitUntilStackUpdateCompleteWithContext(
	_ aws.Context,
	input *cloudformation.DescribeStacksInput,
	_ ...request.WaiterOption,
) error

type Diff

type Diff struct {
	ChangeSet *cloudformation.DescribeChangeSetOutput
	New       *StackState
	Old       *StackState
}

func (*Diff) HasChangeSet

func (diff *Diff) HasChangeSet() bool

func (*Diff) String

func (diff *Diff) String() string

type S3

type S3 interface {
	PutObjectWithContext(
		aws.Context,
		*s3.PutObjectInput,
		...request.Option,
	) (*s3.PutObjectOutput, error)
}

type S3Mock

type S3Mock struct {
	mock.Mock
}

func NewS3Mock

func NewS3Mock() *S3Mock

func (*S3Mock) PutObjectWithContext

func (client *S3Mock) PutObjectWithContext(
	_ aws.Context,
	input *s3.PutObjectInput,
	_ ...request.Option,
) (*s3.PutObjectOutput, error)

func (*S3Mock) PutObjectWithContextMatcher

func (client *S3Mock) PutObjectWithContextMatcher(
	expected *s3.PutObjectInput,
) func(*s3.PutObjectInput) bool

type StackEventCache

type StackEventCache struct {
	// contains filtered or unexported fields
}

func NewStackEventCache

func NewStackEventCache(events []*cloudformation.StackEvent) *StackEventCache

func (*StackEventCache) Contains

func (cache *StackEventCache) Contains(event *cloudformation.StackEvent) bool

func (*StackEventCache) Diff

func (cache *StackEventCache) Diff(
	events []*cloudformation.StackEvent,
) []*cloudformation.StackEvent

type StackState

type StackState struct {
	StackPolicy           interface{}
	TerminationProtection *bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL