Google Cloud Platform Project Service Identity

This page shows how to write Terraform for Cloud Platform Project Service Identity and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (google_project_service_identity)

Warning: These resources are in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources. Generate service identity for a service.

Note: Once created, this resource cannot be updated or destroyed. These actions are a no-op.

Note: This resource can be used to retrieve the emails of the Google-managed service accounts of the APIs that Google has configured with a Service Identity. You can run gcloud beta services identity create --service SERVICE_NAME.googleapis.com to verify if an API supports this. To get more information about Service Identity, see:

Parameters

The following arguments are supported:

  • service - (Required) The service to generate identity for.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

In addition to the arguments listed above, the following computed attributes are exported:

  • email - The email address of the Google managed service account.

Example Usage (from GitHub)

github-iconrjmco/terraform-google-sentinel-double-nested-module
resource "google_project_service_identity" "gke_hostagent_sa" {
  provider = google-beta
  project  = var.service_project_id
  service  = "container.googleapis.com"

  depends_on = [google_project_service.gke_svc]
github-iconrjmco/terraform-google-sentinel-illegal-nested-module
resource "google_project_service_identity" "gke_hostagent_sa" {
  provider = google-beta
  project  = var.service_project_id
  service  = "container.googleapis.com"

  depends_on = [google_project_service.gke_svc]
github-iconrjmco/terraform-google-sentinel-illegal-module
resource "google_project_service_identity" "gke_hostagent_sa" {
  provider = google-beta
  project  = var.service_project_id
  service  = "container.googleapis.com"

  depends_on = [google_project_service.gke_svc]
github-iconrjmco/terraform-google-sentinel-simple-module
resource "google_project_service_identity" "gke_hostagent_sa" {
  provider = google-beta
  project  = var.service_project_id
  service  = "container.googleapis.com"

  depends_on = [google_project_service.gke_svc]

Frequently asked questions

What is Google Cloud Platform Project Service Identity?

Google Cloud Platform Project Service Identity is a resource for Cloud Platform of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud Platform Project Service Identity?

For Terraform, the rjmco/terraform-google-sentinel-double-nested-module, rjmco/terraform-google-sentinel-illegal-nested-module and rjmco/terraform-google-sentinel-illegal-module source code examples are useful. See the Terraform Example section for further details.