google_service_directory_service

An individual service. A service contains a name and optional metadata.

To get more information about Service, see:

Open in Cloud Shell

Example Usage - Service Directory Service Basic

resource "google_service_directory_namespace" "example" {
  provider     = google-beta
  namespace_id = "example-namespace"
  location     = "us-central1"
}

resource "google_service_directory_service" "example" {
  provider   = google-beta
  service_id = "example-service"
  namespace  = google_service_directory_namespace.example.id

  metadata = {
    stage  = "prod"
    region = "us-central1"
  }
}

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:

Import

Service can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}/services/{{service_id}}"
  to = google_service_directory_service.default
}

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

$ terraform import google_service_directory_service.default projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}/services/{{service_id}}
$ terraform import google_service_directory_service.default {{project}}/{{location}}/{{namespace_id}}/{{service_id}}
$ terraform import google_service_directory_service.default {{location}}/{{namespace_id}}/{{service_id}}