Documentation
¶
Index ¶
- Constants
- func GetSqsClient(sess *session.Session) *sqs.SQS
- type AffectedEntity
- type EC2StateChangeDetail
- type EventBridgeEvent
- type InterruptionEventWrapper
- type LifecycleDetail
- type LifecycleDetailMessage
- type NodeInfo
- type RebalanceRecommendationDetail
- type SQSMonitor
- type ScheduledChangeEventDetail
- type SpotInterruptionDetail
- type SqsRetryer
Constants ¶
const ( // SQSMonitorKind is a const to define this monitor kind SQSMonitorKind = "SQS_MONITOR" // ASGTagName is the name of the instance tag whose value is the AutoScaling group name ASGTagName = "aws:autoscaling:groupName" ASGTerminatingLifecycleTransition = "autoscaling:EC2_INSTANCE_TERMINATING" ASGLaunchingLifecycleTransition = "autoscaling:EC2_INSTANCE_LAUNCHING" )
const TEST_NOTIFICATION = "autoscaling:TEST_NOTIFICATION"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AffectedEntity ¶ added in v1.14.0
type AffectedEntity struct {
EntityValue string `json:"entityValue"`
}
AffectedEntity holds information about an entity that is affected by a Health event
type EC2StateChangeDetail ¶
type EC2StateChangeDetail struct {
InstanceID string `json:"instance-id"`
State string `json:"state"`
}
EC2StateChangeDetail holds the event details for EC2 state change events from Amazon EventBridge
type EventBridgeEvent ¶
type EventBridgeEvent struct {
Version string `json:"version"`
ID string `json:"id"`
DetailType string `json:"detail-type"`
Source string `json:"source"`
Account string `json:"account"`
Time string `json:"time"`
Region string `json:"region"`
Resources []string `json:"resources"`
Detail json.RawMessage `json:"detail"`
}
EventBridgeEvent is a structure to hold generic event details from Amazon EventBridge
type InterruptionEventWrapper ¶ added in v1.14.0
type InterruptionEventWrapper struct {
InterruptionEvent *monitor.InterruptionEvent
Err error
}
InterruptionEventWrapper is a convenience wrapper for associating an interruption event with its error, if any
type LifecycleDetail ¶
type LifecycleDetail struct {
LifecycleActionToken string `json:"LifecycleActionToken"`
AutoScalingGroupName string `json:"AutoScalingGroupName"`
LifecycleHookName string `json:"LifecycleHookName"`
EC2InstanceID string `json:"EC2InstanceId"`
LifecycleTransition string `json:"LifecycleTransition"`
Event string `json:"Event"`
RequestID string `json:"RequestId"`
Time string `json:"Time"`
}
LifecycleDetail provides the ASG lifecycle event details
type LifecycleDetailMessage ¶ added in v1.21.0
type LifecycleDetailMessage struct {
Message interface{} `json:"Message"`
}
type NodeInfo ¶ added in v1.14.0
type NodeInfo struct {
AsgName string
InstanceID string
ProviderID string
InstanceType string
IsManaged bool
Name string
Tags map[string]string
}
NodeInfo is relevant information about a single node
type RebalanceRecommendationDetail ¶ added in v1.10.0
type RebalanceRecommendationDetail struct {
InstanceID string `json:"instance-id"`
}
RebalanceRecommendationDetail holds the event details for rebalance recommendation events from Amazon EventBridge
type SQSMonitor ¶
type SQSMonitor struct {
InterruptionChan chan<- monitor.InterruptionEvent
CancelChan chan<- monitor.InterruptionEvent
QueueURL string
SQS sqsiface.SQSAPI
ASG autoscalingiface.AutoScalingAPI
EC2 ec2iface.EC2API
CheckIfManaged bool
ManagedTag string
BeforeCompleteLifecycleAction func()
}
SQSMonitor is a struct definition that knows how to process events from Amazon EventBridge
func (SQSMonitor) Monitor ¶
func (m SQSMonitor) Monitor() error
Monitor continuously monitors SQS for events and coordinates processing of the events
func (SQSMonitor) SendHeartbeats ¶ added in v1.24.0
func (m SQSMonitor) SendHeartbeats(heartbeatInterval int, heartbeatUntil int, lifecycleDetail *LifecycleDetail, stopCh <-chan struct{})
Issue lifecycle heartbeats to reset the heartbeat timeout timer in ASG
type ScheduledChangeEventDetail ¶ added in v1.14.0
type ScheduledChangeEventDetail struct {
EventTypeCategory string `json:"eventTypeCategory"`
Service string `json:"service"`
AffectedEntities []AffectedEntity `json:"affectedEntities"`
}
ScheduledChangeEventDetail holds the event details for AWS Health scheduled EC2 change events from Amazon EventBridge
type SpotInterruptionDetail ¶
type SpotInterruptionDetail struct {
InstanceID string `json:"instance-id"`
InstanceAction string `json:"instance-action"`
}
SpotInterruptionDetail holds the event details for spot interruption events from Amazon EventBridge
type SqsRetryer ¶ added in v1.23.1
type SqsRetryer struct {
client.DefaultRetryer
}
func (SqsRetryer) ShouldRetry ¶ added in v1.23.1
func (r SqsRetryer) ShouldRetry(req *request.Request) bool