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

bigquery slot commitments #6694

Labels
Milestone

Comments

@marengaz
Copy link

marengaz commented Jun 25, 2020

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

following the implementation of #5125. please can you also implement bigquery slot commitments and assignments?

New or Affected Resource(s)

  • google_bigquery_slot_commitment
  • google_bigquery_reservation_assignment

Potential Terraform Configuration

# configuration proposal

resource "google_bigquery_slot_commitment" "my_slot_commitment" {
    id           = (output)
    project       = "my_project"
    location       = "EU"
    slots  = 500
    plan = "MONTHLY"
    renewal_plan = "MONTHLY"
}

# this resource type already exists https://www.terraform.io/docs/providers/google/r/bigquery_reservation.html
resource "google_bigquery_reservation" "my_reservation" {
    name           = "my_reservation"
    project       = "my_project"
    location       = "EU"
    slot_capacity  = 500
    ignore_idle_slots = false
}

resource "google_bigquery_reservation_assignment" "my_reservation_assignment" {
    reservation           = google_bigquery_reservation.my_reservation.id
    assignee           = "projects/myproject"
    job_type             = "QUERY"
}

References

@ghost ghost added enhancement labels Jun 25, 2020
@danawillow danawillow added this to the Goals milestone Jul 7, 2020
@rileykarson rileykarson removed this from the Goals milestone Dec 21, 2020
@rileykarson rileykarson added this to the Near-Term Goals milestone Jan 5, 2021
@BenLiyanage
Copy link

Not sure how much is involved in this but I would potentially be interested in helping out--maybe doing one or two of the resources after being shown how to do the first., or at least reviewing the PR.

@duffenterprises
Copy link

@rileykarson @c2thorn I'm a little confused by all the git merge/re-open, but this is looking like its getting closer. Thanks so much.

@rileykarson
Copy link
Collaborator

rileykarson commented Mar 3, 2022

🤦 Just an overeager robot, the final state today will be open. I'll check back in a few minutes when it should be finished & correct this.

@sesidharreddy
Copy link

is this issue really resolved @rileykarson

@rileykarson rileykarson reopened this Mar 7, 2022
@rileykarson
Copy link
Collaborator

rileykarson commented Mar 7, 2022

Lost track of the tab, sorry. There we go- issue's open, and there's an additional resource before it closes for real. Sorry for the noise/confusion! I'll get us to split the issue before development in the future if a similar case comes up.

@rileykarson rileykarson added this to the Goals milestone Mar 14, 2022
@kyledef
Copy link

kyledef commented Aug 22, 2022

Checking in on this as well. I see that in v 4.32.0, there is both google_bigquery_reservation and google_bigquery_reservation_assignment but there are no configurations for the project slot configuration which is needed before making a reservation.

@DrFaust92
Copy link
Contributor

im going to look into adding the capacity commitment resource

@DrFaust92
Copy link
Contributor

Q for maintainers.

capacity commitment supports crud technically but if we delete it according to docs:

Deletes a capacity commitment. Attempting to delete capacity commitment before its commitmentEndTime will fail with the error code google.rpc.Code.FAILED_PRECONDITION.

@marengaz
Copy link
Author

Docs:
https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.capacityCommitments/delete

Not a maintainer. As a user, I'd expect to see these errors be passed through to my console and the terraform apply fail. Similar to a permission denied error, I guess?

@DrFaust92
Copy link
Contributor

opened best effort PR, will try to test but this can incur a lot of cost so might use google/terraform CI to do cycles.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Oct 17, 2022
…p#6694)

Co-authored-by: Timofey Yushchenko <timus@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Oct 17, 2022
…12807)

Co-authored-by: Timofey Yushchenko <timus@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
Co-authored-by: Timofey Yushchenko <timus@google.com>
@chrisst
Copy link
Contributor

chrisst commented Feb 28, 2023

I did confirm that deleting a capacity commitment before it's time is over will just throw a normal http error and thus will fail the terraform destroy:

│ Error: Error when reading or editing CapacityCommitment: googleapi: Error 400: Cannot delete capacity commitment before commitment end time: 2023-02-28T06:55:26.814144+00:00

Which seems like the right behavior here IMO.

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

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