Skip to content

googleComputeSharedVpcServiceProject

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".

\~> Note: If Shared VPC Admin role is set at the folder level, use the google-beta provider. The google provider only supports this permission at project or organizational level currently. [0]

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.computeSharedVpcServiceProject.ComputeSharedVpcServiceProject(
  this,
  "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 googleComputeSharedVpcHostProject.

Argument Reference

The following arguments are expected:

  • hostProject - (Required) The ID of a host project to associate.

  • serviceProject - (Required) The ID of the project that will serve as a Shared VPC service project.

Attributes Reference

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

  • id - an identifier for the resource with format {{hostProject}}/{{serviceProject}}

Timeouts

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

  • create - Default is 4 minutes.
  • delete - Default is 4 minutes.

Import

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

$ terraform import google_compute_shared_vpc_service_project.service1 host-project-id/service-project-id-1