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 does not support last_period_amount #5245

Closed
umairidris opened this issue Dec 20, 2019 · 4 comments · Fixed by GoogleCloudPlatform/magic-modules#3860 or hashicorp/terraform-provider-google-beta#2378
Assignees
Milestone

Comments

@umairidris
Copy link
Contributor

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 the 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 the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Feedback from @techisland2k19 in hashicorp/terraform-provider-google-beta#1428:

"LastperiodAmount" field doesn't support amount arguement block for terraform google_billing_account resource.Cloud Billing Api doc mention it only. When do you intend to add into resource for terraform?

The reason is in the original PR in magic modules: GoogleCloudPlatform/magic-modules#2734

Specifically @danawillow's comment:

I don't think we have the capability in Terraform, let alone MM, to have a nested object with nothing inside of it. I'd say let's hold off on allowing people to specify this field, and make specifiedAmount required until the API puts something inside the LastPeriodAmount object.

If there is a workaround I am happy to add it. @danawillow do you have any suggestions?

I can also inquire about when the block will have more values as well internally. If you see the doc in https://cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#LastPeriodAmount it mentions:

At this time, the amount is automatically 100% of last period's spend; that is, there are no other options yet. Future configuration will be described here (for example, configuring a percentage of last period's spend).

New or Affected Resource(s)

  • google_billing_budget

Potential Terraform Configuration

resource "google_billing_budget" "budget" {
  ...
  amount {
    last_period_amount {}
  }
  ...
}

References

@danawillow
Copy link
Contributor

The only workaround I can think of would be to add a dummy field (probably a Computed one so that people don't accidentally set it) inside the object that we eventually deprecate. The other option would be to make a boolean instead of a nested block, but that would require a config change for users that eventually migrate from the boolean to the block, so I'm more cautious about something like that.

@danawillow
Copy link
Contributor

@danawillow danawillow added this to the Goals milestone Jan 6, 2020
@nahz
Copy link

nahz commented Aug 12, 2020

I'm looking at adding this functionality at the moment.
Branch is over here: https://github.com/nahz/magic-modules/tree/update-product-billingbudget-amount

Just want to do some more testing before submitting a PR.

@ghost
Copy link

ghost commented Sep 13, 2020

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 and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.