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

Support project service identity #7020

Closed
umairidris opened this issue Aug 13, 2020 · 9 comments · Fixed by GoogleCloudPlatform/magic-modules#3921, #7133 or hashicorp/terraform-provider-google-beta#2437

Comments

@umairidris
Copy link
Contributor

umairidris commented Aug 13, 2020

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

New or Affected Resource(s)

  • google_project_service_identity

Potential Terraform Configuration

resource "google_project_service_identity" "healthcare_identity" {
  project = "foo"
  service = "healthcare.googleapis.com"
}

References

gcloud command: https://cloud.google.com/sdk/gcloud/reference/beta/services/identity/create

@ghost ghost added the enhancement label Aug 13, 2020
@c2thorn c2thorn self-assigned this Aug 17, 2020
@ghost
Copy link

ghost commented Aug 18, 2020

@c2thorn c2thorn added the size/m label Aug 18, 2020
@c2thorn c2thorn removed their assignment Aug 18, 2020
@c2thorn c2thorn added this to the Goals milestone Aug 18, 2020
@c2thorn c2thorn removed this from the Goals milestone Aug 25, 2020
@c2thorn
Copy link
Collaborator

c2thorn commented Aug 25, 2020

b/165640832

@imrannayer
Copy link

We really need this feature as Composer service account use to be part of enabling the service. Recently they changed the behavior and it is not created as part of enabling composer service. It can be enabled by running gcloud beta services identity create --service=composer.googleapis.com

@umairidris
Copy link
Contributor Author

@c2thorn I am looking into adding support for this in magic modules. Thanks!

@umairidris
Copy link
Contributor Author

If anyone wants to use this immediately, an initial version of the resource is available at hashicorp/terraform-provider-google-beta#2430.

I verified correctness with the following config:

data "google_project" "project" {
    project_id = "REPLACE"
}

resource "google_project_service_identity" "healthcare" {
    provider = "google-beta"
    project = data.google_project.project.project_id
    service  = "healthcare.googleapis.com"
}

resource "google_project_iam_member" "bq_jobuser" {
    project = data.google_project.project.project_id
    role    = "roles/bigquery.jobUser"
    member  = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-healthcare.iam.gserviceaccount.com"
}

@imrannayer
Copy link

Thanks. Any ETA when it will be available?

@umairidris
Copy link
Contributor Author

@imrannayer google providers are released on a weekly basis, but if you need it sooner you can clone the repo and run go build to build the provider yourself (and move the binary to the same dir as the deployment or a central one).

@rtoma
Copy link
Contributor

rtoma commented Aug 31, 2020

FYI - for more details/background explained by a Google engineer (afaik), see terraform-google-modules/terraform-google-project-factory#448 (comment)

@ghost
Copy link

ghost commented Sep 27, 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 and limited conversation to collaborators Sep 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.