diff --git a/examples/complete/fixtures.us-east-2.tfvars b/examples/complete/fixtures.us-east-2.tfvars index fdbe73c..272b6aa 100644 --- a/examples/complete/fixtures.us-east-2.tfvars +++ b/examples/complete/fixtures.us-east-2.tfvars @@ -21,6 +21,19 @@ budgets = [ Service = ["Amazon Elastic Compute Cloud - Compute"] } + cost_types = { + include_credit = true + include_discount = true + include_other_subscription = false + include_recurring = true + include_refund = false + include_subscription = true + include_support = false + include_tax = true + include_upfront = false + use_blended = false + } + notification = { comparison_operator = "GREATER_THAN" threshold = "100" diff --git a/main.tf b/main.tf index f0ca6e8..f065ecd 100644 --- a/main.tf +++ b/main.tf @@ -121,6 +121,23 @@ resource "aws_budgets_budget" "default" { time_period_end = lookup(each.value, "time_period_end", null) time_unit = each.value.time_unit + dynamic "cost_types" { + for_each = lookup(each.value, "cost_types", null) != null ? [each.value.cost_types] : [] + + content { + include_credit = lookup(cost_types.value, "include_credit", null) + include_discount = lookup(cost_types.value, "include_discount", null) + include_other_subscription = lookup(cost_types.value, "include_other_subscription", null) + include_recurring = lookup(cost_types.value, "include_recurring", null) + include_refund = lookup(cost_types.value, "include_refund", null) + include_subscription = lookup(cost_types.value, "include_subscription", null) + include_support = lookup(cost_types.value, "include_support", null) + include_tax = lookup(cost_types.value, "include_tax", null) + include_upfront = lookup(cost_types.value, "include_upfront", null) + use_blended = lookup(cost_types.value, "use_blended", null) + } + } + dynamic "cost_filter" { for_each = lookup(each.value, "cost_filter", null) != null ? each.value.cost_filter : {}