google_service_account

Allows management of a Google Cloud service account.

Example Usage

This snippet creates a service account in a project.

resource "google_service_account" "service_account" {
  account_id   = "service-account-id"
  display_name = "Service Account"
}

Argument Reference

The following arguments are supported:

Attributes Reference

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

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

Import

Service accounts can be imported using their URI, e.g.

In Terraform v1.5.0 and later, use an import block to import service accounts using one of the formats above. For example:

import {
  id = "projects/{{project_id}}/serviceAccounts/{{email}}"
  to = google_service_account.default
}

When using the terraform import command, service accounts can be imported using one of the formats above. For example:

$ terraform import google_service_account.default projects/{{project_id}}/serviceAccounts/{{email}}