-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cloud Identity Resources require Delegated Credential #6806
Comments
@seanearley do you want to take a look into below data source to see if it helps? |
Hi, thanks for the reply! This looks like the right direction, but it appears the target_service_account field can only take another service account, not an end user. data "google_service_account_access_token" "default" {
provider = google
target_service_account = "[email protected]"
scopes = ["https://www.googleapis.com/auth/cloud-identity.groups"]
lifetime = "3600s"
} (group-dev) [~/projects/sauce/group-dev]$ terraform plan
Error: "target_service_account" ("[email protected]") doesn't match regexp "((?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))@[a-z]+.gserviceaccount.com$|[0-9]{1,20}[email protected]|[a-z](?:[-a-z0-9]{4,28}[a-z0-9])@[-a-z0-9\\.]{1,63}\\.iam\\.gserviceaccount\\.com$)"
on groups.tf line 9, in data "google_service_account_access_token" "default":
9: data "google_service_account_access_token" "default" { I think the issue is that the For reference, Google has the Python SDK example using the Cloud Identity Groups API here. Note I think there is a typo I will confess we are at the boundaries of my ability to navigate Google Oauth, so happy to take any pointers on correct direction. What I would like to do is be able to use the The G Suite Terraform Provider supports the needed functionality using the |
@seanearley Can you take a look into this? |
Yes, just tried this and it does resolve the issue, we are unblocked for now. Thanks for that find! I do have concerns that this is not an officially supported method. Is there any way to confirm that using the API to directly assign the role will work moving forward? It seems passing an impersonated credential is the preferred approach by Google. |
@seanearley I am glad this helps resolve your issue. What you described is possible but there is no any plan yet. You may file an enhancement for what you prefer and the team could add it into the backlog. I am closing this issue then. Thank you! |
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! |
Community Note
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 tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.12.28
Affected Resource(s)
google_cloud_identity_group
cloud_identity_group_membership
Terraform Configuration Files
Debug Output
https://gist.github.com/seanearley/0d6d99450eac0b13506f15c7cd407380
Expected Behavior
Terraform should have created the group.
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
This is a G Suite domain, not a cloud identity domain.
Typically when accessing G Suite APIs with a a service account you need to create delegated credentials by specifying an email address for a real user. I can't see anyway to configure the Terraform provider to create a delegated credential.
Using the python SDK, I performed two group creation call that were identical, except for the passed credential:
The call with
credentials
generated the same 403 as terraform, while the call withdelegated_credentials
succeeded.The text was updated successfully, but these errors were encountered: