resource "aws_cloudwatch_log_group" "this" { for_each = var.log_groups name = each.value.name retention_in_days = each.value.retention_in_days log_group_class = "STANDARD" tags = each.value.tags } resource "aws_cloudwatch_metric_alarm" "billing" { provider = aws.us_east_1 alarm_name = var.billing_alarm_name alarm_description = "Created from CloudWatch console" comparison_operator = "GreaterThanThreshold" evaluation_periods = 1 metric_name = "EstimatedCharges" namespace = "AWS/Billing" period = 21600 statistic = "Maximum" threshold = 16 actions_enabled = true alarm_actions = var.billing_alarm_action_arns dimensions = { Currency = "USD" } }