sqsevent

package
v1.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const TEST_NOTIFICATION = "autoscaling:TEST_NOTIFICATION"

Variables

This section is empty.

Functions

This section is empty.

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
	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) Kind

func (m SQSMonitor) Kind() string

Kind denotes the kind of monitor

func (SQSMonitor) Monitor

func (m SQSMonitor) Monitor() error

Monitor continuously monitors SQS for events and coordinates processing of the events

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL