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

google_billing_budget: adding an all_updates_rule block returns HTTP 400 #10096

Closed
fourstepper opened this issue Sep 17, 2021 · 2 comments
Closed
Labels

Comments

@fourstepper
Copy link

fourstepper commented Sep 17, 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 -v
Terraform v1.0.6
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v3.84.0
+ provider registry.terraform.io/hashicorp/google-beta v3.79.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Your version of Terraform is out of date! The latest version
is 1.0.7. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

  • google_billing_budget

Terraform Configuration Files

data "google_monitoring_notification_channel" "budget-alerts" {
  project = var.host_project
  display_name = "Budget Alerts"
}

resource "google_billing_budget" "budget" {
  billing_account = var.billing_account
  display_name = "${google_project.project.name} budget"

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

  amount {
    specified_amount {
      currency_code = "EUR"
      units = var.budget_eur
    }
  }
  threshold_rules {
    threshold_percent = 1.2
    spend_basis = "FORECASTED_SPEND"
  }
  threshold_rules {
    threshold_percent = 1
  }
  threshold_rules {
    threshold_percent = 0.8
  }
  all_updates_rule {
    monitoring_notification_channels = [
      data.google_monitoring_notification_channel.budget-alerts.name
    ]
  }
}

Plan

  ~ resource "google_billing_budget" "budget" {
        id              = "billingAccounts/<REDACTED>/budgets/20c2b58d-19ed-4d4a-b8a0-157940eee295"
        name            = "20c2b58d-19ed-4d4a-b8a0-157940eee295"
        # (2 unchanged attributes hidden)

      + all_updates_rule {
          + disable_default_iam_recipients   = true
          + monitoring_notification_channels = [
              + "projects/<REDACTED>/notificationChannels/9045156615967135910",
            ]
          + schema_version                   = "1.0"
        }
    }

Debug Output

-----------------------------------------------------: timestamp=2021-09-17T11:50:13.050+0200
2021-09-17T11:50:13.051+0200 [INFO]  provider.terraform-provider-google_v3.84.0_x5: 2021/09/17 11:50:13 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: googleapi: got HTTP response code 400 with body: HTTP/2.0 400 Bad Request
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Fri, 17 Sep 2021 09:50:12 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT"
  }
}: timestamp=2021-09-17T11:50:13.050+0200
2021-09-17T11:50:13.051+0200 [INFO]  provider.terraform-provider-google_v3.84.0_x5: 2021/09/17 11:50:13 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2021-09-17T11:50:13.050+0200
╷
│ Error: Error creating Budget: googleapi: Error 400: Request contains an invalid argument.
│ 
│   with module.rabbitmq.google_billing_budget.budget,
│   on project-base/budget.tf line 9, in resource "google_billing_budget" "budget":
│    9: resource "google_billing_budget" "budget" {

Expected Behavior

The resource should have been applied successfully. It is, however, only applied successfully if the all_updates_rule block is not present.

Actual Behavior

The API returned Error creating Budget: googleapi: Error 400: Request contains an invalid argument.

Steps to Reproduce

  1. `terraform apply
@fourstepper fourstepper changed the title google_billing_budget: adding an all_updates_rule block returns code 400 google_billing_budget: adding an all_updates_rule block returns HTTP 400 Sep 17, 2021
@fourstepper
Copy link
Author

I think this isn't a bug in the provider, but rather in GCP itself where the created Slack notification channel cannot be chosen even from the GUI; thus, closing

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant