stackset

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stackset provides a client to make API requests to an AWS CloudFormation StackSet resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOrUpdateOption

type CreateOrUpdateOption func(interface{})

CreateOrUpdateOption allows to initialize or update a stack set with additional properties.

func WithAdministrationRoleARN

func WithAdministrationRoleARN(roleARN string) CreateOrUpdateOption

WithAdministrationRoleARN sets an administration role arn for a stack set.

func WithDescription

func WithDescription(description string) CreateOrUpdateOption

WithDescription sets a description for a stack set.

func WithExecutionRoleName

func WithExecutionRoleName(roleName string) CreateOrUpdateOption

WithExecutionRoleName sets an execution role name for a stack set.

func WithOperationID

func WithOperationID(operationID string) CreateOrUpdateOption

WithOperationID sets the operation ID of a stack set operation. This functional option can only be used while updating a stack set, otherwise it's a no-op.

func WithTags

func WithTags(tags map[string]string) CreateOrUpdateOption

WithTags sets tags to all the resources in a stack set.

type Description

type Description struct {
	ID       string
	Name     string
	Template string
}

Description represents a created stack set resource.

type ErrStackSetInstancesNotFound added in v1.21.0

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

ErrStackSetInstancesNotFound occurs when a stack set operation should be applied to instances but they don't exist.

func (*ErrStackSetInstancesNotFound) Error added in v1.21.0

Error implements the error interface.

func (*ErrStackSetInstancesNotFound) IsEmpty added in v1.21.0

func (e *ErrStackSetInstancesNotFound) IsEmpty() bool

IsEmpty reports whether this error is occurs on an empty cloudformation resource.

type ErrStackSetNotFound added in v1.21.0

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

ErrStackSetNotFound occurs when a stack set with the given name does not exist.

func (*ErrStackSetNotFound) Error added in v1.21.0

func (e *ErrStackSetNotFound) Error() string

Error implements the error interface.

func (*ErrStackSetNotFound) IsEmpty added in v1.21.0

func (e *ErrStackSetNotFound) IsEmpty() bool

IsEmpty reports whether this error is occurs on an empty cloudformation resource.

type ErrStackSetOutOfDate

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

ErrStackSetOutOfDate occurs when we try to read and then update a StackSet but between reading it and actually updating it, someone else either started or completed an update.

func (*ErrStackSetOutOfDate) Error

func (e *ErrStackSetOutOfDate) Error() string

type InstanceStatus added in v1.21.0

type InstanceStatus string

InstanceStatus represents a stack set's instance detailed status.

func (InstanceStatus) InProgress added in v1.21.0

func (s InstanceStatus) InProgress() bool

InProgress returns true if the instance is being updated with a new template.

func (InstanceStatus) IsCompleted added in v1.21.0

func (s InstanceStatus) IsCompleted() bool

IsCompleted returns true if the operation is in a final state.

func (InstanceStatus) IsFailure added in v1.21.0

func (s InstanceStatus) IsFailure() bool

IsFailure returns true if the instance cannot be updated and needs to be recovered.

func (InstanceStatus) IsSuccess added in v1.21.1

func (s InstanceStatus) IsSuccess() bool

IsSuccess returns true if the instance is up-to-date with the stack set template.

func (InstanceStatus) String added in v1.21.1

func (s InstanceStatus) String() string

String implements the fmt.Stringer interface.

type InstanceSummariesOption

type InstanceSummariesOption func(input *cloudformation.ListStackInstancesInput)

InstanceSummariesOption allows to filter instance summaries to retrieve for the stack set.

func FilterSummariesByAccountID

func FilterSummariesByAccountID(accountID string) InstanceSummariesOption

FilterSummariesByAccountID limits the accountID for the stack instance summaries to retrieve.

func FilterSummariesByDetailedStatus added in v1.21.0

func FilterSummariesByDetailedStatus(values []InstanceStatus) InstanceSummariesOption

FilterSummariesByDetailedStatus limits the stack instance summaries to the passed status values.

func FilterSummariesByRegion

func FilterSummariesByRegion(region string) InstanceSummariesOption

FilterSummariesByRegion limits the region for the stack instance summaries to retrieve.

type InstanceSummary

type InstanceSummary struct {
	StackID string
	Account string
	Region  string
	Status  InstanceStatus
}

InstanceSummary represents the identifiers for a stack instance.

type OpStatus added in v1.21.0

type OpStatus string

OpStatus represents a stack set operation status.

func (OpStatus) InProgress added in v1.21.1

func (s OpStatus) InProgress() bool

InProgress returns true if the operation has started but hasn't reached a final state yet.

func (OpStatus) IsCompleted added in v1.21.0

func (s OpStatus) IsCompleted() bool

IsCompleted returns true if the operation is in a final state.

func (OpStatus) IsFailure added in v1.21.0

func (s OpStatus) IsFailure() bool

IsFailure returns true if the operation terminated in failure.

func (OpStatus) IsSuccess added in v1.21.1

func (s OpStatus) IsSuccess() bool

IsSuccess returns true if the operation is completed successfully.

func (OpStatus) String added in v1.21.1

func (s OpStatus) String() string

String implements the fmt.Stringer interface.

type Operation added in v1.21.0

type Operation struct {
	ID     string
	Status OpStatus
	Reason string
}

Operation represents information about a stack set operation.

type StackSet

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

StackSet represents an AWS CloudFormation client to interact with stack sets.

func New

func New(s *session.Session) *StackSet

New creates a new client to make requests against stack sets.

func (*StackSet) Create

func (ss *StackSet) Create(name, template string, opts ...CreateOrUpdateOption) error

Create creates a new stack set resource, if one already exists then do nothing.

func (*StackSet) CreateInstances

func (ss *StackSet) CreateInstances(name string, accounts, regions []string) (string, error)

CreateInstances creates new stack instances within the regions of the specified AWS accounts and returns the operation ID.

func (*StackSet) CreateInstancesAndWait

func (ss *StackSet) CreateInstancesAndWait(name string, accounts, regions []string) error

CreateInstancesAndWait creates new stack instances in the regions of the specified AWS accounts, and waits until the operation completes.

func (*StackSet) Delete

func (ss *StackSet) Delete(name string) error

Delete deletes the stack set, if the stack set does not exist then just return nil.

func (*StackSet) DeleteAllInstances added in v1.21.0

func (ss *StackSet) DeleteAllInstances(name string) (string, error)

DeleteAllInstances removes all stack instances from a stack set and returns the operation ID. If the stack set does not exist, then return ErrStackSetNotFound. If the stack set does not have any instances, then return ErrStackSetInstancesNotFound. Both errors should satisfy [IsEmptyStackSetErr], otherwise it's an unexpected error.

func (*StackSet) DeleteInstance added in v1.29.0

func (ss *StackSet) DeleteInstance(name, account, region string) (string, error)

DeleteInstance deletes the stackset instance for the stackset with the given name in the given account and region and returns the operation ID. If there is no instance in the given account and region, this function will return an operation ID but the API call will take no action.

func (*StackSet) Describe

func (ss *StackSet) Describe(name string) (Description, error)

Describe returns a description of a created stack set.

func (*StackSet) DescribeOperation added in v1.21.0

func (ss *StackSet) DescribeOperation(name, opID string) (Operation, error)

DescribeOperation returns a description of the operation.

func (*StackSet) InstanceSummaries

func (ss *StackSet) InstanceSummaries(name string, opts ...InstanceSummariesOption) ([]InstanceSummary, error)

InstanceSummaries returns a list of unique identifiers for all the stack instances in a stack set.

func (*StackSet) Update

func (ss *StackSet) Update(name, template string, opts ...CreateOrUpdateOption) (string, error)

Update updates all the instances in a stack set with the new template and returns the operation ID.

func (*StackSet) UpdateAndWait

func (ss *StackSet) UpdateAndWait(name, template string, opts ...CreateOrUpdateOption) error

UpdateAndWait updates a stack set with a new template, and waits until the operation completes.

func (*StackSet) WaitForOperation added in v1.21.0

func (ss *StackSet) WaitForOperation(name, opID string) error

WaitForOperation waits for the operation with opID to reaches a successful completion status.

func (*StackSet) WaitForStackSetLastOperationComplete added in v1.6.0

func (ss *StackSet) WaitForStackSetLastOperationComplete(name string) error

WaitForStackSetLastOperationComplete waits until the stackset's last operation completes.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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