google_network_connectivity_service_connection_policy

Manage Service Connection Policies.

To get more information about ServiceConnectionPolicy, see:

Open in Cloud Shell

Example Usage - Network Connectivity Policy Basic

resource "google_compute_network" "producer_net" {
  name                    = "producer-net"
  auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "producer_subnet" {
  name          = "producer-subnet"
  ip_cidr_range = "10.0.0.0/16"
  region        = "us-central1"
  network       = google_compute_network.producer_net.id
}

resource "google_network_connectivity_service_connection_policy" "default" {
  name = "my-network-connectivity-policy"
  location = "us-central1"
  service_class = "my-basic-service-class"
  description   = "my basic service connection policy"
  network = google_compute_network.producer_net.id
  psc_config {
    subnetworks = [google_compute_subnetwork.producer_subnet.id]
    limit = 2
  }
}

Argument Reference

The following arguments are supported:


The psc_config block supports:

Attributes Reference

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

The psc_connections block contains:

The error block supports:

The error_info block supports:

Timeouts

This resource provides the following Timeouts configuration options:

Import

ServiceConnectionPolicy can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}"
  to = google_network_connectivity_service_connection_policy.default
}

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

$ terraform import google_network_connectivity_service_connection_policy.default projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}
$ terraform import google_network_connectivity_service_connection_policy.default {{project}}/{{location}}/{{name}}
$ terraform import google_network_connectivity_service_connection_policy.default {{location}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.