-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.tf
61 lines (52 loc) · 2.22 KB
/
main.tf
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
#
# AWS Billing Alerts
#
# Billing = U$S50
module "aws_cost_mgmt_billing_alert_50" {
source = "github.com/binbashar/terraform-aws-cost-billing-alarm.git?ref=v1.0.14"
aws_env = "${var.project}-${var.environment}-50"
monthly_billing_threshold = var.monthly_billing_threshold_50
currency = var.currency
create_sns_topic = false
sns_topic_arns = [data.terraform_remote_state.notifications.outputs.sns_topic_arn_costs]
tags = local.tags
}
# Billing = U$S100
module "aws_cost_mgmt_billing_alert_100" {
source = "github.com/binbashar/terraform-aws-cost-billing-alarm.git?ref=v1.0.14"
aws_env = "${var.project}-${var.environment}-100"
monthly_billing_threshold = var.monthly_billing_threshold_100
currency = var.currency
create_sns_topic = false
sns_topic_arns = [data.terraform_remote_state.notifications.outputs.sns_topic_arn_costs]
tags = local.tags
}
#
# AWS Budget
#
# Budget = U$S100 at 75%
module "aws_cost_mgmt_budget_notif_75" {
source = "github.com/binbashar/terraform-aws-cost-budget.git?ref=v1.0.12"
aws_env = "${var.environment}-75-percent"
currency = var.currency
limit_amount = var.monthly_billing_threshold_100
time_unit = var.time_unit
time_period_start = var.time_period_start
notification_threshold = var.notification_threshold_75
aws_sns_account_id = var.accounts.root.id
create_sns_topic = false
sns_topic_arns = [data.terraform_remote_state.notifications.outputs.sns_topic_arn_costs]
}
# Budget = U$S100 at 100%
module "aws_cost_mgmt_budget_notif_100" {
source = "github.com/binbashar/terraform-aws-cost-budget.git?ref=v1.0.12"
aws_env = "${var.environment}-100-percent"
currency = var.currency
limit_amount = var.monthly_billing_threshold_100
time_unit = var.time_unit
time_period_start = var.time_period_start
notification_threshold = var.notification_threshold_100
aws_sns_account_id = var.accounts.root.id
create_sns_topic = false
sns_topic_arns = [data.terraform_remote_state.notifications.outputs.sns_topic_arn_costs]
}