Documentation
¶
Overview ¶
Package asg provides an interface to ASG Lifecycle Hooks, that are delivered via SQS. It manages a local cache, which is filled from SQS messages. The instance lifecycle can be completed, so the ASG can continue to terminate an instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Run executes the SQS message listener. It will update the instance cache // based on SQS Messages. It will poll all messages from the ASG Lifecycle // Hook and will keep them inflight until the instance actually disapeared. Run(ctx context.Context) error // List returns all EC2 Instances that are currently in the cache. Those // instance cache will be updated in the background, based on SQS Messages. List() []Instance // Complete finishes the ASG Lifecycle Hook Action with "CONTINUE". Complete(ctx context.Context, id string) error // Delete deletes the message from SQS. Delete(ctx context.Context, id string) error // SignalEmitter gets triggered every time the cache changes. See syncutil // package for more information. SignalEmitter() *syncutil.SignalEmitter // Healthy indicates whether the background job is running correctly. Healthy() bool }
Client is an interface to ASG Lifecycle Hooks.
type Instance ¶
type Instance struct { // ID is the EC2 Instance ID ID string `logfield:"instance-id,omitempty"` // TriggeredAt is the thime then the shutdown was triggered. TriggeredAt time.Time `logfield:"lifecycle-triggered-at"` // Completed indicates that Complete() was called. Completed bool `logfield:"lifecycle-completed"` // Deleted indicates that Delete() was called. Deleted bool `logfield:"lifecycle-deleted"` }
Instance is the instance-related data that is retrieved via SQS.
Click to show internal directories.
Click to hide internal directories.