-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
53 lines (50 loc) · 1.44 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
terraform {
required_version = "1.9.5"
backend "s3" {
key = "capra-playground/state.tfstate"
bucket = "<account-id>-terraform-state" # TODO: Din AWS konto-ID.
dynamodb_table = "<account-id>-terraform-lock" # TODO: Din AWS konto-ID.
region = "eu-west-1"
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.60.0"
}
}
}
provider "aws" {
region = "eu-west-1"
allowed_account_ids = ["<account-id>"] # TODO: Din AWS konto-ID.
}
locals {
name_prefix = "capra-playground"
email = "<email>" # TODO: Din e-post
tags = {
project = local.name_prefix
terraform = true
}
}
resource "aws_budgets_budget" "this" {
name = "${local.name_prefix}-monthly"
budget_type = "COST"
limit_amount = "50"
limit_unit = "USD"
time_period_end = "2087-06-15_00:00"
time_period_start = "2017-07-01_00:00"
time_unit = "MONTHLY"
notification {
comparison_operator = "GREATER_THAN"
threshold = 80
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = [local.email]
}
notification {
comparison_operator = "GREATER_THAN"
threshold = 100
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
subscriber_email_addresses = [local.email]
}
}