forked from arhs/spikeseed-cloud-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_5.js
43 lines (40 loc) · 1.29 KB
/
app_5.js
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
const cdk = require('@aws-cdk/core')
const budgets = require('@aws-cdk/aws-budgets')
class BudgetStack extends cdk.Stack {
constructor(scope, id, vpcStack, props) {
super(scope, id, props)
new budgets.CfnBudget(this, 'Budget', {
budget: {
budgetLimit: {
amount: 1000,
unit: 'USD'
},
budgetType: 'COST',
timeUnit: 'MONTHLY',
costFilters: {
Service: [
'Amazon Elastic Compute Cloud - Compute',
'Amazon Elastic Block Store'
],
TagKeyValue: [
'user:Application$MyApp'
]
}
},
notificationsWithSubscribers: [{
notification: {
comparisonOperator: 'GREATER_THAN',
notificationType: 'ACTUAL',
threshold: 80,
thresholdType: 'PERCENTAGE'
},
subscribers: [{
subscriptionType: 'EMAIL',
address: 'my@email.com'
}]
}]
})
}
}
const app = new cdk.App()
new BudgetStack(app, 'BudgetStack')