google_network_services_service_binding

ServiceBinding is the resource that defines a Service Directory Service to be used in a BackendService resource.

To get more information about ServiceBinding, see:

Open in Cloud Shell

Example Usage - Network Services Service Binding Basic

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
}

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

ServiceBinding can be imported using any of these accepted formats:

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}}

User Project Overrides

This resource supports User Project Overrides.