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

Support of commited use discounts (CUD) #6734

Comments

@thirdeyenick
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 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

We would like create commited use discounts (only resource based commitments for now) via terraform. As we are defining all our google projects and resources via terraform, it would be very nice to also be able to create CUDs in a declarative way. I understand that these are a bit special resources as they can only be created and listed (updating and deleting is not supported). I also don't know yet how they would be tested as creating 'temporary' commitments doesn't seem to be supported. Maybe someone has an idea?

New or Affected Resource(s)

  • google_compute_region_commitment

Potential Terraform Configuration

resource google_compute_region_commitment "test" {
  project = "test-1234"
  region = "us-east-1"
  name = "test-commitment"
  plan = "TWELVE_MONTH"
  type = "GENERAL_PURPOSE"
  resources {
    cpu = 2
    memory = 2048
    local_ssd = 2
    accelerator {
       type = "nvidia-tesla-v100"
       amount = 4
    }
  }
}

References

I did not find any github issues referencing CUDs so far.

@ghost ghost added enhancement labels Jul 3, 2020
@danawillow danawillow added this to the Goals milestone Jul 7, 2020
@pdecat
Copy link
Contributor

pdecat commented Nov 2, 2021

I believe this is covered by the google_compute_reservation resource: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_reservation

Maybe the documentation for that resource should be updated to mention CUD and Committed Use Discounts.

@pdecat
Copy link
Contributor

pdecat commented Nov 2, 2021

Oops, I'm mistaken apparently 🤦

Reservations and CUDs are too separate things...

https://cloud.google.com/compute/docs/reference/rest/v1/reservations
https://cloud.google.com/compute/docs/reference/rest/v1/regionCommitments

@jholowaty
Copy link

Hi! this was added in some version of tf? thks!

@ahmedloai
Copy link

Any updates here regarding the support of terraform for GCP CUDs creation and management...!

@stawik-mesa
Copy link

Hi,
I will try to implement it. Testing might be challenging as CUDs can't be destroyed.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Oct 26, 2022
modular-magician added a commit that referenced this issue Oct 26, 2022
Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
@AlfatahB
Copy link
Contributor

b/227525247

@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 May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.