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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow force creation of datastream stream and skip validation #14022

Closed
kliu47 opened this issue Mar 17, 2023 · 10 comments 路 Fixed by GoogleCloudPlatform/magic-modules#10684, hashicorp/terraform-provider-google-beta#7382 or #18176

Comments

@kliu47
Copy link

kliu47 commented Mar 17, 2023

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

Creation of google_datastream_stream fails when terraform is unable to successfully complete validation. Request is the ability to allow creation of the resource in the NOT_STARTED state similiar to how one would use gcloud datastream update -force

New or Affected Resource(s)

  • google_datastream_stream

Potential Terraform Configuration

resource "google_datastream_stream" "example" {

  display_name  = "example-stream"
  location      = "us-east1"
  stream_id     = "example-db-gcs"
  desired_state = "NOT_STARTED"
  force = true 
source_config {}
destination_config {}
}

References

  • #0000

b/299600924

@rileykarson
Copy link
Collaborator

@melinath to triage

@melinath
Copy link
Collaborator

@iperetz-goo what do you think about this?

@iperetz-goo
Copy link
Contributor

@melinath yep thats a reasonable request, we expose this capability in the API via a request parameter - force=true
Usually users want this in cases when the validation failure are expectable to them

@rileykarson rileykarson added this to the Goals milestone Mar 27, 2023
@BrettNWoods

This comment was marked as off-topic.

@iperetz-goo

This comment was marked as off-topic.

@github-actions github-actions bot added forward/review In review; remove label to forward service/datastream labels Aug 17, 2023
@melinath melinath removed the forward/review In review; remove label to forward label Sep 7, 2023
@tcaddy
Copy link

tcaddy commented Mar 11, 2024

My current work-around is to ClickOps the resource with identical values to what's defined in HCL code, then import the resource with an import {} block. And it imports successfully with zero changes.

@w32-blaster
Copy link

We are facing the same issue when creating the google_datastream_connection_profile. More specifically whe try to set up the connection to cloudsql using a private connection and a proxy service. The proxy is being created in a later stage of the pipeline (on gke) so the validation of the connection to cloudsql is not working at the moment when it is created through terraform.
Since the whole pipeline includes creating everything (including the gcp project) we have this odd race condition like the one mentioned above. Would like to see a way to ignore the validation on the connection_profile

@tsantandreu
Copy link

@tcaddy Can you provide sample code on your work around.

@tcaddy
Copy link

tcaddy commented Apr 3, 2024

I actually figured out the cause of my issue and it kinda explains how my "work around" even worked in the first place.

Here's what happened: we were refreshing a lower environment with a restore of the prod database. It just so happens that we had the same username and host for the cloud sql users in both production and lower environments, but the passwords were different.

Terraform never detected the drift (the fact that the passwords didn't match). The solution is to delete the cloud sql user accounts after restore and let terraform recreate them with the correct password.

@tsantandreu

@w32-blaster
Copy link

Creating the profile without validation would be still useful. When a proxy is needed to connect the datastream to cloudsql, a proxy is needed. Creating this proxy is not necessarily tied to the same process. This causes terraform to fail because of the validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment