google_compute_shared_vpc_service_project

Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a Shared VPC service project associated with a given host project.

For more information, see, the Project API documentation, where the Shared VPC feature is referred to by its former name "XPN".

Example Usage

resource "google_compute_shared_vpc_service_project" "service1" {
  host_project    = "host-project-id"
  service_project = "service-project-id-1"
}

For a complete Shared VPC example with both host and service projects, see google_compute_shared_vpc_host_project.

Argument Reference

The following arguments are expected:

Attributes Reference

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

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

Import

Google Compute Engine Shared VPC service project feature can be imported using the host_project and service_project, e.g.

In Terraform v1.5.0 and later, use an import block to import Google Compute Engine Shared VPC service project using one of the formats above. For example:

import {
  id = "{{host_project}/{{service_project}}"
  to = google_compute_shared_vpc_service_project.default
}

When using the terraform import command, Google Compute Engine Shared VPC service project can be imported using one of the formats above. For example:

$ terraform import google_compute_shared_vpc_service_project.default {{host_project}/{{service_project}}
``