An individual service. A service contains a name and optional metadata.
To get more information about Service, see:
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"
}
}
The following arguments are supported:
namespace
-
(Required)
The resource name of the namespace this service will belong to.
service_id
-
(Required)
The Resource ID must be 1-63 characters long, including digits,
lowercase letters or the hyphen character.
metadata
-
(Optional)
Metadata for the service. This data can be consumed
by service clients. The entire metadata dictionary may contain
up to 2000 characters, spread across all key-value pairs.
Metadata that goes beyond any these limits will be rejected.In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{name}}
name
-
The resource name for the service in the
format projects/*/locations/*/namespaces/*/services/*
.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Service can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}/services/{{service_id}}
{{project}}/{{location}}/{{namespace_id}}/{{service_id}}
{{location}}/{{namespace_id}}/{{service_id}}
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}}