ServiceBinding is the resource that defines a Service Directory Service to be used in a BackendService resource.
To get more information about ServiceBinding, see:
resource "google_service_directory_namespace" "default" {
provider = google-beta
namespace_id = "my-namespace"
location = "us-central1"
}
resource "google_service_directory_service" "default" {
provider = google-beta
service_id = "my-service"
namespace = google_service_directory_namespace.default.id
metadata = {
stage = "prod"
region = "us-central1"
}
}
resource "google_network_services_service_binding" "default" {
provider = google-beta
name = "my-service-binding"
labels = {
foo = "bar"
}
description = "my description"
service = google_service_directory_service.default.id
}
The following arguments are supported:
service
-
(Required)
The full Service Directory Service name of the format
projects//locations//namespaces//services/
name
-
(Required)
Name of the ServiceBinding resource.
labels
-
(Optional)
Set of label tags associated with the ServiceBinding resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
description
-
(Optional)
A free-text description of the resource. Max length 1024 characters.
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:
id
- an identifier for the resource with format projects/{{project}}/locations/global/serviceBindings/{{name}}
create_time
-
Time the ServiceBinding was created in UTC.
update_time
-
Time the ServiceBinding was updated in UTC.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 10 minutes.update
- Default is 10 minutes.delete
- Default is 10 minutes.ServiceBinding can be imported using any of these accepted formats:
projects/{{project}}/locations/global/serviceBindings/{{name}}
{{project}}/{{name}}
{{name}}
In Terraform v1.5.0 and later, use an import
block to import ServiceBinding using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/global/serviceBindings/{{name}}"
to = google_network_services_service_binding.default
}
When using the terraform import
command, ServiceBinding can be imported using one of the formats above. For example:
$ terraform import google_network_services_service_binding.default projects/{{project}}/locations/global/serviceBindings/{{name}}
$ terraform import google_network_services_service_binding.default {{project}}/{{name}}
$ terraform import google_network_services_service_binding.default {{name}}
This resource supports User Project Overrides.