Skip to content

Commit

Permalink
Made billing budget filter labels updatable (#5545) (#10767)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Dec 16, 2021
1 parent 4539e26 commit a54fad2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/5545.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
billingbudget: fixed a bug where `google_billing_budget.budget_filter.labels` was not updating.
```
3 changes: 2 additions & 1 deletion google/resource_billing_budget.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
7 changes: 7 additions & 0 deletions google/resource_billing_budget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ resource "google_billing_budget" "budget" {
budget_filter {
projects = ["projects/${data.google_project.project.number}"]
labels = {
label = "bar"
}
}
amount {
Expand Down Expand Up @@ -173,6 +176,7 @@ resource "google_billing_budget" "budget" {
budget_filter {
projects = []
labels = {}
}
amount {
Expand Down Expand Up @@ -218,6 +222,9 @@ resource "google_billing_budget" "budget" {
budget_filter {
projects = []
labels = {
label1 = "bar2"
}
}
amount {
Expand Down

0 comments on commit a54fad2

Please sign in to comment.