Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot clear projects from google_billing_budget #8888

Assignees
Labels

Comments

@juliocc
Copy link

juliocc commented Apr 12, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.14.10

  • provider registry.terraform.io/hashicorp/google v3.63.0

Affected Resource(s)

  • google_billing_budget

Terraform Configuration Files

resource "google_billing_budget" "budget" {
  billing_account = var.billing_account
  display_name    = "my budget"
  amount {
    last_period_amount = true
  }
  threshold_rules {
    threshold_percent = 1.0
  }
  budget_filter {
    projects = [
      var.project_number_1,
      var.project_number_2
    ]
  }
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Removing the budget_filter block from an existing budget should clear the projects from the underlying resource.

Actual Behavior

Projects are not removed and budget remains the same.

Steps to Reproduce

  1. Provide values to billing_account, project_number_1 and project_number_2
  2. terraform apply the code shown above
  3. Remove the billing_filter block
  4. terraform apply again

Important Factoids

Adding other projects or removing some projects works correctly. The problem is updating an existing budget by removing the budget_filter block or setting projects to null or []

References

N/A

@venkykuberan
Copy link
Contributor

@juliocc can you please attach the debug log of your update call , after removing the budget_filter.

@juliocc
Copy link
Author

juliocc commented Apr 15, 2021

@ghost ghost removed the waiting-response label Apr 15, 2021
@venkykuberan
Copy link
Contributor

Looks like UpdateMask need to include this field in the update call., @melinath

@melinath
Copy link
Collaborator

@juliocc the fix to this bug will still require you to set projects = [] and apply prior to deleting the block altogether. This is due to implementation details about terraform core (and the fact that the budget filter block is considered Optional + Computed).

@ghost
Copy link

ghost commented May 24, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.