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_cloud_identity_group import not working #7006

Closed
jenshonkan84 opened this issue Aug 12, 2020 · 7 comments · Fixed by GoogleCloudPlatform/magic-modules#3862 or hashicorp/terraform-provider-google-beta#2379

Comments

@jenshonkan84
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 an 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 an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.12.28

Affected Resource(s)

  • google_cloud_identity_group

Terraform Configuration Files

resource "google_cloud_identity_group" "sandbox-group" {
  provider = google-beta
  display_name = trimsuffix(var.teamgroup, "@blaj.se")

  parent = "customers/xxxxxx"

  group_key {
    id = var.teamgroup
  }

  labels = {
    "cloudidentity.googleapis.com/groups.discussion_forum" = ""
  }
}

terraform import -provider=google-beta module.teamsandbox.google_cloud_identity_group.sandbox-group groups/Xxxxxxxxx

Debug Output

module.teamsandbox.google_cloud_identity_group.sandbox-group: Refreshing state... [id=groups]
62 Error: Error when reading or editing CloudIdentityGroup "groups": googleapi: Error 400: Parent must be specified
63 Details:
64 [
65 {
66 "@type": "type.googleapis.com/google.rpc.BadRequest"
67 }
68 ]

Panic Output

Expected Behavior

Import my group in to the state file.

Actual Behavior

Tells me to specify parent but this is already present in the resource.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the bug label Aug 12, 2020
@edwardmedia edwardmedia self-assigned this Aug 12, 2020
@edwardmedia
Copy link
Contributor

@jenshonkan84 can you try using config like below instead?

resource "google_cloud_identity_group" "sandbox-group" {
}

@jenshonkan84
Copy link
Author

jenshonkan84 commented Aug 13, 2020

@edwardmedia

Tried your suggestion but same error:

$ terraform import -provider=google-beta module.teamsandbox.google_cloud_identity_group.sandbox-group groups/032hXXXXXXXXX
59 Acquiring state lock. This may take a few moments...
60 module.teamsandbox.google_cloud_identity_group.sandbox-group: Importing from ID "groups/032hXXXXXXX"...
61 module.teamsandbox.google_cloud_identity_group.sandbox-group: Import prepared!
62   Prepared google_cloud_identity_group for import
63 module.teamsandbox.google_cloud_identity_group.sandbox-group: Refreshing state... [id=groups]
64 Error: Error when reading or editing CloudIdentityGroup "groups": googleapi: Error 400: Parent must be specified
65 Details:
66 [
67   {
68     "@type": "type.googleapis.com/google.rpc.BadRequest"
69   }
70 ]

Terraform code:

resource "google_cloud_identity_group" "sandbox-group" {
 
}

@ghost ghost removed waiting-response labels Aug 13, 2020
@edwardmedia
Copy link
Contributor

@jenshonkan84 I am not sure how your module is built. To test if the import works, can you use the config provided with below command? (remove modules in your code temporarily)

terraform import -provider=google-beta google_cloud_identity_group.default {{name}}

@jenshonkan84
Copy link
Author

@edwardmedia

Same result:

resource "google_cloud_identity_group" "cloud_identity_group_basica" {
}
$ terraform import -provider=google-beta google_cloud_identity_group.cloud_identity_group_basica groups/032hioqXXXXXX
google_cloud_identity_group.cloud_identity_group_basica: Importing from ID "groups/032hioXXXXX"...
google_cloud_identity_group.cloud_identity_group_basica: Import prepared!
  Prepared google_cloud_identity_group for import
google_cloud_identity_group.cloud_identity_group_basica: Refreshing state... [id=groups]
Error: Error when reading or editing CloudIdentityGroup "groups": googleapi: Error 400: Parent must be specified
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.BadRequest"
  }
]

@ghost ghost removed the waiting-response label Aug 13, 2020
@edwardmedia
Copy link
Contributor

@jenshonkan84 What do you see if you run below below command?

gcloud beta identity groups describe {{email}}

@megan07
Copy link
Contributor

megan07 commented Aug 13, 2020

Hi @jenshonkan84 @edwardmedia - I see the problem. I need to add a custom import in order to allow us to import names with slashes in them groups/xxxxxxx, I'll add that in now. Thanks for catching this!

@ghost
Copy link

ghost commented Sep 13, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 13, 2020
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloudidentity-groups labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants