# README
Lambda: EKS Event CloudWatch
A Lambda for forwarding CloudWatch Alarms to EKS Events.
flowchart LR
CloudWatch --> Lambda
Lambda --> EKS
EKS --> Kubectl
Requirements
AWS IAM Permissions
{
"Statement": [
{
"Action": "cloudwatch:ListTagsForResource",
"Effect": "Allow",
"Resource": "*"
},
{
"Action": "eks:DescribeCluster",
"Effect": "Allow",
"Resource": "arn:aws:eks:REGION:ACCOUNT_ID:cluster/CLUSTER_NAME"
}
],
"Version": "2012-10-17"
}
Kubernetes RBAC
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: NAME
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
CloudWatch Alarm Tags
skpr.io/k8s-event-api-version
skpr.io/k8s-event-kind
skpr.io/k8s-event-cluster
skpr.io/k8s-event-namespace
skpr.io/k8s-event-name
Sample Lambda Event
{
"alarmArn": "arn:aws:cloudwatch:ap-southeast-2:ACCOUNT_ID:alarm:CLOUDWATCH_ALARM_NAME",
"alarmData": {
"alarmName": "CLOUDWATCH_ALARM_NAME",
"state": {
"reason": "FAILING"
},
"configuration": {
"description": "This is a test"
}
}
}
# Packages
No description provided by the author
# Functions
HandleLambdaEvent will respond to a CloudWatch Alarm, check for rate limited IP addresses and send a message to Slack.
# Variables
GitVersion overridden at build time by: -ldflags="-X main.GitVersion=${VERSION}".