terraform-provider-google icon indicating copy to clipboard operation
terraform-provider-google copied to clipboard

Support of commited use discounts (CUD)

Open thirdeyenick opened this issue 5 years ago • 5 comments

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.

thirdeyenick avatar Jul 03 '20 10:07 thirdeyenick

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 avatar Nov 02 '21 15:11 pdecat

Oops, I'm mistaken apparently :facepalm:

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

pdecat avatar Nov 02 '21 15:11 pdecat

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

jholowaty avatar May 17 '22 13:05 jholowaty

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

ahmedloai avatar Aug 22 '22 06:08 ahmedloai

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

stawik-mesa avatar Sep 21 '22 13:09 stawik-mesa

b/227525247

AlfatahB avatar Dec 30 '22 05:12 AlfatahB

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[bot] avatar May 14 '23 02:05 github-actions[bot]