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_active_folder doesn't find folders with dash in displayName #7385

Closed
rosmo opened this issue Sep 29, 2020 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#4032, #7395 or hashicorp/terraform-provider-google-beta#2528
Assignees
Labels

Comments

@rosmo
Copy link

rosmo commented Sep 29, 2020

Terraform Version

Terraform v0.13.3

  • provider registry.terraform.io/-/google v3.40.0
  • provider registry.terraform.io/hashicorp/google v3.40.0

Affected Resource(s)

  • google_active_folder

Terraform Configuration Files

data "google_active_folder" "folder_parent" {
  display_name = "Folder - Deprecated"
  parent       = format("organizations/%s", var.organization_id)
}

Debug Output

The request the Google provider does looks like this:

POST /v2/folders:search?alt=json&prettyPrint=false HTTP/1.1
Host: cloudresourcemanager.googleapis.com
User-Agent: google-api-go-client/0.5 HashiCorp Terraform/0.13.3 (+https://www.terraform.io) Terraform Plugin SDK/1.11.0 terraform-provider-google/3.40.0
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.14.5 gdcl/20200911
Accept-Encoding: gzip

{
  "query": "lifecycleState=ACTIVE AND parent=folders/1234567890 AND displayName=Folder+-+Deprecated"
}

The API just returns {}.

For some reason, this method of escaping spaces/dashes does not work. The same request with a different style escaping returns the correct result:

curl -X POST -H 'Content-Type: application/json' -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" 'https://cloudresourcemanager.googleapis.com/v2/folders:search?alt=json&prettyPrint=false' -d '{"query":"lifecycleState=ACTIVE AND parent=organizations/1234567890 AND displayName=\"Folder - Deprecated\""}'

Expected Behavior

Folder is found.

Actual Behavior

Folder is not found.

Steps to Reproduce

  1. terraform plan
@rosmo
Copy link
Author

rosmo commented Sep 30, 2020

By the way, I think the dash is at fault at here since another folder with only a space in it works fine.

@ghost
Copy link

ghost commented Oct 31, 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 as resolved and limited conversation to collaborators Oct 31, 2020
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloudresourcemanager-crm labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.