-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcf-budget.yaml
More file actions
95 lines (92 loc) · 2.94 KB
/
Copy pathcf-budget.yaml
File metadata and controls
95 lines (92 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an AWS budget and notifies you when you exceed thresholds.
Parameters:
Name:
Description: The name of the budget
Type: String
Default: Budget-Sandbox
Amount:
Description: What your budget is for the month
Type: Number
Default: 12
Currency:
Description: The currency of your budget
Type: String
Default: USD
FirstThreshold:
Description: The first threshold at which you'll receive a notification
Type: Number
Default: 75
SecondThreshold:
Description: The second threshold at which you'll receive a notification
Type: Number
Default: 99
FirstEmail:
Description: The email address to send notifications to
Type: String
Default: myemail@corp.com
SecondEmail:
Description: The email address to send notifications to
Type: String
Default: myemail@corp.com
pEnvironment:
Description: environment
Type: String
Default: noprod
# Order the parameters in a way that makes more sense (not alphabetized)
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Parameters:
- Name
- Amount
- Currency
- FirstThreshold
- SecondThreshold
- FirstEmail
- SecondEmail
Resources:
### Budget ###
Budget:
Type: AWS::Budgets::Budget
Properties:
Budget:
BudgetName: !Ref Name
BudgetLimit:
Amount: !Ref Amount
Unit: !Ref Currency
TimeUnit: MONTHLY
BudgetType: COST
# "A budget can have up to five notifications. Each notification must have at least one subscriber.
# A notification can have one SNS subscriber and up to ten email subscribers, for a total of 11 subscribers."
NotificationsWithSubscribers:
- Notification:
ComparisonOperator: GREATER_THAN
NotificationType: ACTUAL
Threshold: !Ref FirstThreshold
ThresholdType: PERCENTAGE
Subscribers:
- SubscriptionType: EMAIL
Address: !Ref FirstEmail
- SubscriptionType: EMAIL
Address: !Ref SecondEmail
- Notification:
ComparisonOperator: GREATER_THAN
NotificationType: ACTUAL
Threshold: !Ref SecondThreshold
ThresholdType: PERCENTAGE
Subscribers:
- SubscriptionType: EMAIL
Address: !Ref FirstEmail
- SubscriptionType: EMAIL
Address: !Ref SecondEmail
- Notification:
ComparisonOperator: GREATER_THAN
NotificationType: FORECASTED
Threshold: 100
ThresholdType: PERCENTAGE
Subscribers:
- SubscriptionType: EMAIL
Address: !Ref FirstEmail
- SubscriptionType: EMAIL
Address: !Ref SecondEmail