From 3b51940120dd5417551f3885f9fdcc08fbc41648 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Thu, 16 Dec 2021 18:16:36 +0000 Subject: [PATCH] Made billing budget filter labels updatable (#5545) Signed-off-by: Modular Magician --- .changelog/5545.txt | 3 +++ google/resource_billing_budget.go | 3 ++- google/resource_billing_budget_test.go | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changelog/5545.txt diff --git a/.changelog/5545.txt b/.changelog/5545.txt new file mode 100644 index 00000000000..64c5401d635 --- /dev/null +++ b/.changelog/5545.txt @@ -0,0 +1,3 @@ +```release-note:bug +billingbudget: fixed a bug where `google_billing_budget.budget_filter.labels` was not updating. +``` diff --git a/google/resource_billing_budget.go b/google/resource_billing_budget.go index d7477702233..8e39c1b6003 100644 --- a/google/resource_billing_budget.go +++ b/google/resource_billing_budget.go @@ -468,7 +468,8 @@ func resourceBillingBudgetUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("budget_filter") { - updateMask = append(updateMask, "budgetFilter.projects") + updateMask = append(updateMask, "budgetFilter.projects", + "budgetFilter.labels") } if d.HasChange("amount") { diff --git a/google/resource_billing_budget_test.go b/google/resource_billing_budget_test.go index ba2b9ad57c3..7461515c5fb 100644 --- a/google/resource_billing_budget_test.go +++ b/google/resource_billing_budget_test.go @@ -128,6 +128,9 @@ resource "google_billing_budget" "budget" { budget_filter { projects = ["projects/${data.google_project.project.number}"] + labels = { + label = "bar" + } } amount { @@ -173,6 +176,7 @@ resource "google_billing_budget" "budget" { budget_filter { projects = [] + labels = {} } amount { @@ -218,6 +222,9 @@ resource "google_billing_budget" "budget" { budget_filter { projects = [] + labels = { + label1 = "bar2" + } } amount {