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

Budget module triggers update in-place and 400 error #537

Closed
chiokejjones opened this issue Jan 15, 2021 · 1 comment
Closed

Budget module triggers update in-place and 400 error #537

chiokejjones opened this issue Jan 15, 2021 · 1 comment

Comments

@chiokejjones
Copy link

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

0.13.5

Affected Resource(s)

terraform-google-modules/project-factory/google//modules/budget

Terraform Configuration Files

module "budget" {
  source                 = "terraform-google-modules/project-factory/google//modules/budget"
  version                = "~> 9.2"
  billing_account        = var.billing_account_id
  projects               = [module.project_factory.project_number]
  display_name           = "${module.project_factory.project_name}-budget-${var.billing_budget}"
  amount                 = var.billing_budget
  alert_spent_percents   = var.billing_thresholds
  credit_types_treatment = var.billing_include_credits ? "INCLUDE_ALL_CREDITS" : "EXCLUDE_ALL_CREDITS"
  alert_pubsub_topic     = var.consumer_org_name == "org_name" ? local.backup_budget_topic : local.prod_budget_topic
}

Debug Output

Panic Output

Expected Behavior

There should be no changes to the billing resources.

Actual Behavior

Plan wants to add all_upates_rule and remove currency_code. Neither of which are set in the module or are available parameters.

# module.budget.google_billing_budget.budget[0] will be updated in-place
  ~ resource "google_billing_budget" "budget" {
        billing_account = "<some_numbers>"
        display_name    = "chioke-budget-500"
        id              = "billingAccounts/<some_numbers>/budgets/<some_numbers>"
        name            = "billingAccounts/<some_numbers>/budgets/<some_numbers>"

      + all_updates_rule {
          + disable_default_iam_recipients   = false
          + monitoring_notification_channels = []
          + schema_version                   = "1.0"
        }

      ~ amount {
            last_period_amount = false

          ~ specified_amount {
              - currency_code = "USD" -> null
                nanos         = 0
                units         = "500"
            }
        }

        budget_filter {
            credit_types           = []
            credit_types_treatment = "EXCLUDE_ALL_CREDITS"
            labels                 = {}
            projects               = [
                "projects/<some_numbers>",
            ]
            services               = []
            subaccounts            = []
        }

        threshold_rules {
            spend_basis       = "CURRENT_SPEND"
            threshold_percent = 0.5
        }
        threshold_rules {
            spend_basis       = "CURRENT_SPEND"
            threshold_percent = 0.75
        }
        threshold_rules {
            spend_basis       = "CURRENT_SPEND"
            threshold_percent = 0.9
        }
        threshold_rules {
            spend_basis       = "CURRENT_SPEND"
            threshold_percent = 1
        }
    }

TF run errors with:

Error: Error updating Budget "billingAccounts/<some-numbers>/budgets/<some-numbers>": googleapi: Error 400: Request contains an invalid argument.

Steps to Reproduce

  1. terraform plan
  2. See update in place for google_billing_budget
  3. terraform apply
  4. Fails with above error.

Important Factoids

References

  • #0000
@morgante
Copy link
Contributor

This looks like a provider issue. Tracking there: hashicorp/terraform-provider-google#8228

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

No branches or pull requests

2 participants