Created
January 14, 2024 19:01
-
-
Save maguzzi/2103834f2054d96db296169896a5bf11 to your computer and use it in GitHub Desktop.
Budget and monitor cloudformation stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Parameters": { | |
"EmailAddressForNotificationParameter": { | |
"Description": "Email address for the notification", | |
"Type": "String" | |
} | |
}, | |
"Description": "Static website budget", | |
"Resources": { | |
"Budget": { | |
"Type": "AWS::Budgets::Budget", | |
"Properties": { | |
"Budget": { | |
"BudgetLimit": { | |
"Amount": "6", | |
"Unit": "USD" | |
}, | |
"TimeUnit": "MONTHLY", | |
"BudgetName": "A few bucks a month", | |
"BudgetType": "COST" | |
}, | |
"NotificationsWithSubscribers": [ | |
{ | |
"Notification": { | |
"NotificationType": "FORECASTED", | |
"ComparisonOperator": "GREATER_THAN", | |
"Threshold": 80, | |
"ThresholdType": "PERCENTAGE" | |
}, | |
"Subscribers": [ | |
{ | |
"SubscriptionType": "EMAIL", | |
"Address": { "Ref": "EmailAddressForNotificationParameter"} | |
} | |
] | |
} | |
] | |
} | |
}, | |
"AnomalyServiceMonitor": { | |
"Type" : "AWS::CE::AnomalyMonitor", | |
"Properties" : { | |
"MonitorDimension" : "SERVICE", | |
"MonitorName" : "Website monitor", | |
"MonitorType": "DIMENSIONAL" | |
} | |
}, | |
"AnomalySubscription": { | |
"Type": "AWS::CE::AnomalySubscription", | |
"Properties": { | |
"SubscriptionName": "Email to stakeholder", | |
"Threshold": 10, | |
"Frequency": "DAILY", | |
"MonitorArnList": [ | |
{ "Ref": "AnomalyServiceMonitor"} | |
], | |
"Subscribers": [ | |
{ | |
"Type": "EMAIL", | |
"Address": { "Ref": "EmailAddressForNotificationParameter"} | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment