Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventPrinter ¶
func EventPrinter(event *cloudformation.StackEvent) error
EventPrinter implements EventConsumer interface to print cloudformation.StackEvent to stdout.
func NoStackUpdatesToPerform ¶
NoStackUpdatesToPerform inspects awserr.Error to detect if a Cloudformation Stack does not rquire any updates.
The aws-go-sdk doesn't return an easily detectable Code. UpdateStack returns a "ValidationError" error with a specific Message. This function searches for the message that indicates not updates are to be performed.
Types ¶
type EventConsumer ¶
type EventConsumer interface {
Consume(*cloudformation.StackEvent) error
}
EventConsumer is an interface used by Stack.SyncAndPollEvents() to consume events polled from an updating Cloudformation Stack.
type EventConsumerFunc ¶
type EventConsumerFunc func(*cloudformation.StackEvent) error
func (EventConsumerFunc) Consume ¶
func (e EventConsumerFunc) Consume(event *cloudformation.StackEvent) error
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack synchronizes a StackConfig with the corresponding Cloudformation Stack. Stack simplifies the Cloudformation's API by issuing CreateStack or UpdateStack depending on whether the stack name represented at StackConfig.Name exists in Cloudformation.
To synchronize a StackConfig with the Cloudformation Stack, call Sync().
If you need to wait for the Cloudformation Stack to complete creating or updating, call SyncAndPollEvents(). SyncAndPollEvents() takes an argument that implements the EventConsumer interface in which events are passed.
func LoadStack ¶
func LoadStack(api cloudformationiface.CloudFormationAPI, config *StackConfig) (*Stack, error)
LoadStack allocates a new Stack used to synchronize a StackConfig's configuration with a new or existing Cloudformation Stack.
func (*Stack) Sync ¶
Sync applies the stack configuration to Cloudformation Stack. If the Cloudformation Stack does not exist, Sync will create a new Cloudformation Stack. If the Cloudformation Stack does exist, then Sync will update the Cloudformation Stack.
func (*Stack) SyncAndPollEvents ¶
func (s *Stack) SyncAndPollEvents(consumer EventConsumer) error
Runs Sync() and then polls for StackEvents to pass to consumer. This call will block until the Cloudformation Stack has completed creating or updating a Cloudformation Stack.
StackEvents passed to consumer appear in chronological order.
type StackConfig ¶
type StackConfig struct { Name string TemplateURL string TemplatePath string TemplateBody templateBody Parameters map[string]string Tags map[string]string Capabilities []string // Settings for CreateStack() DisableRollback bool // Settings for CreateStack() EnableTerminationProtection bool // Settings for CreateStack() OnFailure string }
func NewStackFromYAML ¶
func NewStackFromYAML(doc []byte) (*StackConfig, error)