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

Can't set disable_default_iam_recipients to true if monitoring_notification_channels are not set or threshold_rules are set #17808

Open
krisztiansala opened this issue Apr 10, 2024 · 2 comments

Comments

@krisztiansala
Copy link

krisztiansala commented Apr 10, 2024

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version

1.6.3

Affected Resource(s)

google_billing_budget

Terraform Configuration

resource "google_billing_budget" "budget" {
  billing_account = var.billing_account
  display_name    = "Billing Budget ${var.project_id}"

  budget_filter {
    projects = ["projects/${var.project_number}"]
  }

  amount {
    specified_amount {
      currency_code = var.currency
      units         = var.amount
    }
  }

  threshold_rules {
    threshold_percent = 1.0
    spend_basis       = "FORECASTED_SPEND"
  }

  all_updates_rule {
    disable_default_iam_recipients   = true
    pubsub_topic                     = var.pubsub_topic
  }
}

Debug Output

Error updating Budget "billingAccounts/123/budgets/12345": googleapi: Error 400: Request contains an invalid argument.

Expected Behavior

We should be able to set disable_default_iam_recipients as true in all cases.

Actual Behavior

If I mark disable_default_iam_recipients as true, when the monitoring_notification_channels are not set (only pubsub), or when threshold_rules are set (which is normal), we get that generic "Request contains an invalid argument" error.

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/335295571

@github-actions github-actions bot added forward/review In review; remove label to forward service/billingbudgets labels Apr 10, 2024
@ggtisc ggtisc assigned ggtisc and ScottSuarez and unassigned ggtisc Apr 10, 2024
@melinath melinath assigned melinath and unassigned ScottSuarez Apr 16, 2024
@melinath
Copy link
Collaborator

melinath commented Apr 16, 2024

I can reproduce this with the following config:

Reproduction config
data "google_project" "project" {
}

resource "google_pubsub_topic" "example" {
  name = "example-topic"

  labels = {
    foo = "bar"
  }

  message_retention_duration = "86600s"
}

resource "google_billing_budget" "budget" {
  billing_account = data.google_project.project.billing_account
  display_name    = "Billing Budget Test"

  budget_filter {
    projects = ["projects/${data.google_project.project.number}"]
  }

  amount {
    specified_amount {
      currency_code = "USD"
      units = "100000"
    }
  }

  threshold_rules {
    threshold_percent = 1.0
    spend_basis       = "FORECASTED_SPEND"
  }

  all_updates_rule {
    disable_default_iam_recipients   = true
    pubsub_topic                     = google_pubsub_topic.example.id
  }
}

Removing the all_updates_rule block allows the config to be applied successfully.

@melinath melinath removed the forward/review In review; remove label to forward label Apr 16, 2024
@melinath melinath removed their assignment Apr 16, 2024
@d-costa
Copy link

d-costa commented Dec 5, 2024

This is probably not a bug in the provider, since this can be reproduced through the console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants