Documentation ¶
Overview ¶
Package cloudformation provides a client to make API requests to AWS CloudFormation.
Index ¶
- func ExtractChangeSetName(arn string) string
- func GetChangeSetName(generation int64, sourceRevision string) string
- func New(ctx context.Context, region string) (clients.CloudFormationClient, error)
- type CloudFormation
- func (c *CloudFormation) ContinueStackRollback(stack *types.Stack) error
- func (c *CloudFormation) CreateStack(stack *types.Stack) (changeSetArn string, err error)
- func (c *CloudFormation) DeleteChangeSet(stack *types.Stack) error
- func (c *CloudFormation) DeleteStack(stack *types.Stack) error
- func (c *CloudFormation) DescribeChangeSet(stack *types.Stack) (*types.ChangeSetDescription, error)
- func (c *CloudFormation) DescribeStack(stack *types.Stack) (*types.StackDescription, error)
- func (c *CloudFormation) ExecuteChangeSet(stack *types.Stack) error
- func (c *CloudFormation) UpdateStack(stack *types.Stack) (changeSetArn string, err error)
- type ErrChangeSetEmpty
- type ErrChangeSetNotFound
- type ErrStackNotFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractChangeSetName ¶
ExtractChangeSetName extracts the name of the change set from the change set ARN Example: arn:aws:cloudformation:us-west-2:123456789012:changeSet/<name>/<uuid> -> name
func GetChangeSetName ¶
GetChangeSetName generates a unique change set name using the generation number (a specific version of the CloudFormationStack Spec contents) and the source revision (such as the branch and commit ID for git sources).
Examples:
Git repository: main@sha1:132f4e719209eb10b9485302f8593fc0e680f4fc Bucket: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 OCI repository: latest@sha256:3b6cdcc7adcc9a84d3214ee1c029543789d90b5ae69debe9efa3f66e982875de
Types ¶
type CloudFormation ¶
type CloudFormation struct {
// contains filtered or unexported fields
}
CloudFormation represents a client to make requests to AWS CloudFormation.
func NewWithClient ¶
func NewWithClient(ctx context.Context, client client) *CloudFormation
For passing a mock client in tests
func (*CloudFormation) ContinueStackRollback ¶
func (c *CloudFormation) ContinueStackRollback(stack *types.Stack) error
ContinueStackRollback attempts to continue an Update rollback for an existing CloudFormation stack.
func (*CloudFormation) CreateStack ¶
func (c *CloudFormation) CreateStack(stack *types.Stack) (changeSetArn string, err error)
CreateStack begins the process of deploying a new CloudFormation stack by creating a change set. The change set must be executed when it is successfully created.
func (*CloudFormation) DeleteChangeSet ¶
func (c *CloudFormation) DeleteChangeSet(stack *types.Stack) error
Delete removes an existing CloudFormation change set. If the change set doesn't exist then do nothing.
func (*CloudFormation) DeleteStack ¶
func (c *CloudFormation) DeleteStack(stack *types.Stack) error
Delete removes an existing CloudFormation stack. If the stack doesn't exist then do nothing.
func (*CloudFormation) DescribeChangeSet ¶
func (c *CloudFormation) DescribeChangeSet(stack *types.Stack) (*types.ChangeSetDescription, error)
DescribeChangeSet gathers and returns all changes for the stack's current change set. If the stack or changeset does not exist, returns ErrChangeSetNotFound.
func (*CloudFormation) DescribeStack ¶
func (c *CloudFormation) DescribeStack(stack *types.Stack) (*types.StackDescription, error)
Describe returns a description of an existing stack. If the stack does not exist, returns ErrStackNotFound.
func (*CloudFormation) ExecuteChangeSet ¶
func (c *CloudFormation) ExecuteChangeSet(stack *types.Stack) error
ExecutChangeSet starts the execution of the stack's current change set. If the stack or changeset does not exist, returns ErrChangeSetNotFound.
func (*CloudFormation) UpdateStack ¶
func (c *CloudFormation) UpdateStack(stack *types.Stack) (changeSetArn string, err error)
UpdateStack begins the process of updating an existing CloudFormation stack with new configuration by creating a change set. The change set must be executed when it is successfully created.
type ErrChangeSetEmpty ¶
type ErrChangeSetEmpty struct { Arn string // contains filtered or unexported fields }
ErrChangeSetEmpty occurs when the change set does not contain any new or updated resources.
func (*ErrChangeSetEmpty) Error ¶
func (e *ErrChangeSetEmpty) Error() string
type ErrChangeSetNotFound ¶
type ErrChangeSetNotFound struct {
// contains filtered or unexported fields
}
ErrChangeSetNotFound occurs when a CloudFormation changeset does not exist.
func (*ErrChangeSetNotFound) Error ¶
func (e *ErrChangeSetNotFound) Error() string
type ErrStackNotFound ¶
type ErrStackNotFound struct {
// contains filtered or unexported fields
}
ErrStackNotFound occurs when a CloudFormation stack does not exist.
func (*ErrStackNotFound) Error ¶
func (e *ErrStackNotFound) Error() string