Documentation
¶
Overview ¶
Package stackset provides a client to make API requests to an AWS CloudFormation StackSet resource.
Index ¶
- type CreateOrUpdateOption
- func WithAdministrationRoleARN(roleARN string) CreateOrUpdateOption
- func WithDescription(description string) CreateOrUpdateOption
- func WithExecutionRoleName(roleName string) CreateOrUpdateOption
- func WithOperationID(operationID string) CreateOrUpdateOption
- func WithTags(tags map[string]string) CreateOrUpdateOption
- type Description
- type ErrStackSetInstancesNotFound
- type ErrStackSetNotFound
- type ErrStackSetOutOfDate
- type InstanceStatus
- type InstanceSummariesOption
- type InstanceSummary
- type OpStatus
- type Operation
- type StackSet
- func (ss *StackSet) Create(name, template string, opts ...CreateOrUpdateOption) error
- func (ss *StackSet) CreateInstances(name string, accounts, regions []string) (string, error)
- func (ss *StackSet) CreateInstancesAndWait(name string, accounts, regions []string) error
- func (ss *StackSet) Delete(name string) error
- func (ss *StackSet) DeleteAllInstances(name string) (string, error)
- func (ss *StackSet) Describe(name string) (Description, error)
- func (ss *StackSet) DescribeOperation(name, opID string) (Operation, error)
- func (ss *StackSet) InstanceSummaries(name string, opts ...InstanceSummariesOption) ([]InstanceSummary, error)
- func (ss *StackSet) Update(name, template string, opts ...CreateOrUpdateOption) (string, error)
- func (ss *StackSet) UpdateAndWait(name, template string, opts ...CreateOrUpdateOption) error
- func (ss *StackSet) WaitForOperation(name, opID string) error
- func (ss *StackSet) WaitForStackSetLastOperationComplete(name string) error
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 ¶
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
func (e *ErrStackSetInstancesNotFound) Error() string
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
InProgress returns true if the operation has started but hasn't reached a final state yet.
func (OpStatus) IsCompleted ¶ added in v1.21.0
IsCompleted returns true if the operation is in a final state.
func (OpStatus) IsFailure ¶ added in v1.21.0
IsFailure returns true if the operation terminated in failure.
type StackSet ¶
type StackSet struct {
// contains filtered or unexported fields
}
StackSet represents an AWS CloudFormation client to interact with 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 ¶
CreateInstances creates new stack instances within the regions of the specified AWS accounts and returns the operation ID.
func (*StackSet) CreateInstancesAndWait ¶
CreateInstancesAndWait creates new stack instances in the regions of the specified AWS accounts, and waits until the operation completes.
func (*StackSet) Delete ¶
Delete deletes the stack set, if the stack set does not exist then just return nil.
func (*StackSet) DeleteAllInstances ¶ added in v1.21.0
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) 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
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
WaitForOperation waits for the operation with opID to reaches a successful completion status.
func (*StackSet) WaitForStackSetLastOperationComplete ¶ added in v1.6.0
WaitForStackSetLastOperationComplete waits until the stackset's last operation completes.