2017-10-11 19:51:09 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_compute_shared_vpc_host_project"
|
|
|
|
sidebar_current: "docs-google-compute-shared-vpc-host-project"
|
|
|
|
description: |-
|
2017-11-13 20:48:18 +00:00
|
|
|
Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a host project.
|
2017-10-11 19:51:09 +00:00
|
|
|
---
|
|
|
|
|
2017-11-13 20:48:18 +00:00
|
|
|
# google_compute_shared_vpc_host_project
|
2017-10-11 19:51:09 +00:00
|
|
|
|
2017-11-13 20:48:18 +00:00
|
|
|
Enables the Google Compute Engine
|
|
|
|
[Shared VPC](https://cloud.google.com/compute/docs/shared-vpc)
|
|
|
|
feature for a project, assigning it as a Shared VPC host project.
|
|
|
|
|
|
|
|
For more information, see,
|
|
|
|
[the Project API documentation](https://cloud.google.com/compute/docs/reference/latest/projects),
|
|
|
|
where the Shared VPC feature is referred to by its former name "XPN".
|
2017-10-11 19:51:09 +00:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```hcl
|
2017-11-13 20:48:18 +00:00
|
|
|
# A host project provides network resources to associated service projects.
|
2017-10-11 19:51:09 +00:00
|
|
|
resource "google_compute_shared_vpc_host_project" "host" {
|
2017-11-13 20:48:18 +00:00
|
|
|
project = "host-project-id"
|
2017-10-11 19:51:09 +00:00
|
|
|
}
|
|
|
|
|
2017-11-13 20:48:18 +00:00
|
|
|
# A service project gains access to network resources provided by its
|
|
|
|
# associated host project.
|
2017-10-11 19:51:09 +00:00
|
|
|
resource "google_compute_shared_vpc_service_project" "service1" {
|
2017-11-13 20:48:18 +00:00
|
|
|
host_project = "${google_compute_shared_vpc_host_project.host.project}"
|
|
|
|
service_project = "service-project-id-1"
|
2017-10-11 19:51:09 +00:00
|
|
|
}
|
|
|
|
resource "google_compute_shared_vpc_service_project" "service2" {
|
2017-11-13 20:48:18 +00:00
|
|
|
host_project = "${google_compute_shared_vpc_host_project.host.project}"
|
|
|
|
service_project = "service-project-id-2"
|
2017-10-11 19:51:09 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
2017-11-13 20:48:18 +00:00
|
|
|
The following arguments are expected:
|
2017-10-11 19:51:09 +00:00
|
|
|
|
2017-11-13 20:48:18 +00:00
|
|
|
* `project` - (Required) The ID of the project that will serve as a Shared VPC host project
|
2017-10-11 19:51:09 +00:00
|
|
|
|