cloudwatch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmDimension

type AlarmDimension struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

AlarmDimension describes a config setting for the trigger

type AlarmMessage

type AlarmMessage struct {
	Subject          string       `json:"-"`
	AlarmName        string       `json:"AlarmName"`
	AlarmDescription string       `json:"AlarmDescription"`
	AWSAccountID     string       `json:"AWSAccountId"`
	OldStateValue    string       `json:"OldStateValue"`
	NewStateValue    string       `json:"NewStateValue"`
	NewStateReason   string       `json:"NewStateReason"`
	StateChangeTime  string       `json:"StateChangeTime"`
	Region           string       `json:"Region"`
	Trigger          AlarmTrigger `json:"Trigger"`
}

AlarmMessage describes a CloudWatch Alarm SNS event

type AlarmTrigger

type AlarmTrigger struct {
	MetricName         string           `json:"MetricName"`
	Namespace          string           `json:"Namespace"`
	Statistic          string           `json:"Statistic"`
	Unit               string           `json:"Unit"`
	Dimensions         []AlarmDimension `json:"Dimensions"`
	Period             int              `json:"Period"`
	EvaluationPeriods  int              `json:"EvaluationPeriods"`
	ComparisonOperator string           `json:"ComparisonOperator"`
	Threshold          float32          `json:"Threshold"`
}

AlarmTrigger describes the SNS Alarm trigger

type SNSEntity

type SNSEntity struct {
	Signature         string                 `json:"Signature"`
	MessageID         string                 `json:"MessageId"`
	Type              string                 `json:"Type"`
	TopicArn          string                 `json:"TopicArn"`
	MessageAttributes map[string]interface{} `json:"MessageAttributes"`
	SignatureVersion  string                 `json:"SignatureVersion"`
	Timestamp         string                 `json:"Timestamp"`
	SigningCertURL    string                 `json:"SigningCertUrl"`
	Message           string                 `json:"Message"`
	UnsubscribeURL    string                 `json:"UnsubscribeUrl"`
	Subject           string                 `json:"Subject"`
}

SNSEntity is the message details for the SNS event

type SNSEvent

type SNSEvent struct {
	Records []SNSEventRecord `json:"Records"`
}

SNSEvent is a set of EventRecords

type SNSEventRecord

type SNSEventRecord struct {
	EventVersion         string    `json:"EventVersion"`
	EventSubscriptionArn string    `json:"EventSubscriptionArn"`
	EventSource          string    `json:"EventSource"`
	SNS                  SNSEntity `json:"Sns"`
}

SNSEventRecord is an SNS event

func (*SNSEventRecord) DecodedMessage

func (r *SNSEventRecord) DecodedMessage() (AlarmMessage, error)

DecodedMessage decodes the message body of an SNS record

Jump to

Keyboard shortcuts

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