Skip to content

Commit

Permalink
fix(account_billing_alert): fix deprecat threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
vsnunes committed Aug 7, 2024
1 parent 0415c6e commit 6d93cc6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/account_billing_alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ The module is intended to be used in a subaccount, not in a root account which s
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.30.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.51.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.30.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.51.0 |

## Modules

Expand Down
9 changes: 8 additions & 1 deletion modules/account_billing_alert/cost_anomaly_detection.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ resource "aws_ce_anomaly_monitor" "service_monitor" {
resource "aws_ce_anomaly_subscription" "service_monitor_subscritpion" {
count = var.anomaly_detection_threshold == 0 ? 0 : 1
name = "DAILYSUBSCRIPTION"
threshold = var.anomaly_detection_threshold
frequency = "DAILY"

threshold_expression {
dimension {
key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE"
match_options = ["GREATER_THAN_OR_EQUAL"]
values = [var.anomaly_detection_threshold]
}
}

monitor_arn_list = [
aws_ce_anomaly_monitor.service_monitor[0].arn,
]
Expand Down
2 changes: 1 addition & 1 deletion modules/account_billing_alert/requirements.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_version = ">= 1.0.0"
required_providers {
aws = {
version = ">= 4.30.0"
version = ">= 4.51.0"
}
}
}

0 comments on commit 6d93cc6

Please sign in to comment.