-
Notifications
You must be signed in to change notification settings - Fork 59
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
terraform import googleworkspace_user
needs clarification
#266
Comments
+1, was stuck figuring this out for a bit |
Thanks for posting your issue and solution here @pat-s - I've investigated this and it's definitely interesting how For users I found out that the numerical ID shown in the current example in the docs, ie. :
is a unique ID that all Google accounts are assigned. They're not the same as the alphanumerical identifier shown in the URL of a user in Google Workspace and I don't think they're viewable in the Google Workspace UI anywhere. I think the only ways to view them are in API responses and, weirdly, via the approach in this gist: https://gist.github.com/msafi/b1cb05bfab5b897c57e6 I also checked the import for groups and saw how the alphanumerical identifier in Google Workspace URLs can be used for import in that case. This is definitely confusing, so I'll update the docs for both resources to recommend using emails when importing to state. Thanks again for flagging it 😁 |
I just verified that running IMPORT using the primary_email works just fine. I would recommend the example show import using a username. If there are edge cases that require the numeric ID, then that could be added to the docs as a note. |
Reading the documentation of v0.6.0, I assumed I need to pass the "ID" shown in the URL when visiting a user profile.
However, this value is not accepted.
Using the primary email of a user succeeds but does not update the actual
terraform
block.Anyhow, I think the example in https://registry.terraform.io/providers/hashicorp/googleworkspace/latest/docs/resources/user#import should note that the primary email should be used.
Is the empty import a bug of the
googleworkspace_user
resource or am I doing something wrong?Edit: the import issue also applies to
googleworkspace_group
whereas here the actual "ID" found in the URL can be usedThe text was updated successfully, but these errors were encountered: