cloudformation

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package cloudformation provides the API operation methods for making requests to AWS CloudFormation.

Index

Constants

View Source
const (
	// MaxWaitCreateUpdateDelete is the default maximum amount of time to wait for a cfn stack to complete.
	MaxWaitCreateUpdateDelete = 30 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CFNAPI added in v2.9.0

type CFNAPI interface {
	CreateStack(ctx context.Context, params *cfn.CreateStackInput, optFns ...func(*cfn.Options)) (*cfn.CreateStackOutput, error)
	DeleteStack(ctx context.Context, params *cfn.DeleteStackInput, optFns ...func(*cfn.Options)) (*cfn.DeleteStackOutput, error)
	DescribeStacks(ctx context.Context, params *cfn.DescribeStacksInput, optFns ...func(*cfn.Options)) (*cfn.DescribeStacksOutput, error)
	DescribeStackResources(ctx context.Context, params *cfn.DescribeStackResourcesInput, optFns ...func(*cfn.Options)) (*cfn.DescribeStackResourcesOutput, error)
	UpdateStack(ctx context.Context, params *cfn.UpdateStackInput, optFns ...func(*cfn.Options)) (*cfn.UpdateStackOutput, error)

	// Waiters for CFN stacks
	WaitUntilStackCreateComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error
	WaitUntilStackUpdateComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error
	WaitUntilStackDeleteComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error
}

CFNAPI defines the CFN API interface.

type CFNClient added in v2.9.0

type CFNClient struct {
	*cfn.Client
}

CFNClient is a wrapper over cfn.Client for implementing custom methods of CFNAPI.

func (*CFNClient) WaitUntilStackCreateComplete added in v2.9.0

func (c *CFNClient) WaitUntilStackCreateComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error

WaitUntilStackCreateComplete is blocking function to wait until CFN Stack is successfully created.

func (*CFNClient) WaitUntilStackDeleteComplete added in v2.9.0

func (c *CFNClient) WaitUntilStackDeleteComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error

WaitUntilStackDeleteComplete is blocking function to wait until CFN Stack is successfully deleted.

func (*CFNClient) WaitUntilStackUpdateComplete added in v2.9.0

func (c *CFNClient) WaitUntilStackUpdateComplete(ctx context.Context, input *cfn.DescribeStacksInput, maxWait time.Duration) error

WaitUntilStackUpdateComplete is blocking function to wait until CFN Stack is successfully updated.

type Service

type Service struct {
	CFN CFNAPI
}

Service holds a collection of interfaces. The interfaces are broken down like this to group functions together. One alternative is to have a large list of functions from the ec2 client.

func NewService

func NewService(i CFNAPI) *Service

NewService returns a new service given the CloudFormation api client.

func (*Service) DeleteStack

func (s *Service) DeleteStack(ctx context.Context, stackName string, retainResources []string) error

DeleteStack deletes a cloudformation stack.

func (*Service) ReconcileBootstrapNoUpdate added in v2.1.0

func (s *Service) ReconcileBootstrapNoUpdate(ctx context.Context, stackName string, t go_cfn.Template, tags map[string]string) error

ReconcileBootstrapNoUpdate creates or updates bootstrap CloudFormation without updating the stack.

func (*Service) ReconcileBootstrapStack

func (s *Service) ReconcileBootstrapStack(ctx context.Context, stackName string, t go_cfn.Template, tags map[string]string) error

ReconcileBootstrapStack creates or updates bootstrap CloudFormation.

func (*Service) ShowStackResources

func (s *Service) ShowStackResources(ctx context.Context, stackName string) error

ShowStackResources prints out in tabular format the resources in the stack.

Jump to

Keyboard shortcuts

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