Skip to content

Commit

Permalink
website: revised documentation for Compute Shared VPC resources (#725)
Browse files Browse the repository at this point in the history
The documentation pages for these two resources were previously a little
muddled, with the argument references swapped and a non-working example
for the host project.
  • Loading branch information
apparentlymart authored and rosbo committed Nov 13, 2017
1 parent 68c6641 commit 182f878
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
36 changes: 19 additions & 17 deletions website/docs/r/compute_shared_vpc_host_project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,42 @@ layout: "google"
page_title: "Google: google_compute_shared_vpc_host_project"
sidebar_current: "docs-google-compute-shared-vpc-host-project"
description: |-
Allows enabling and disabling Shared VPC for the host Google Cloud Platform project.
Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a host project.
---

# google\_compute\_shared\_vpc\_host\_project
# google_compute_shared_vpc_host_project

Allows enabling and disabling Shared VPC for the host Google Cloud Platform project. For more information see
[the official documentation](https://cloud.google.com/compute/docs/shared-vpc)
and
[API](https://cloud.google.com/compute/docs/reference/latest/projects).
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".

## Example Usage

```hcl
# A host project provides network resources to associated service projects.
resource "google_compute_shared_vpc_host_project" "host" {
project = "your-host-project-id"
project = "host-project-id"
}
# A service project gains access to network resources provided by its
# associated host project.
resource "google_compute_shared_vpc_service_project" "service1" {
project = "your-service-project-id-1"
// The host project must enable shared VPC first
depends_on = ["google_compute_shared_vpc_host_project.host"]
host_project = "${google_compute_shared_vpc_host_project.host.project}"
service_project = "service-project-id-1"
}
resource "google_compute_shared_vpc_service_project" "service2" {
project = "your-service-project-id-2"
// The host project must enable shared VPC first
depends_on = ["google_compute_shared_vpc_host_project.host"]
host_project = "${google_compute_shared_vpc_host_project.host.project}"
service_project = "service-project-id-2"
}
```

## Argument Reference

The following arguments are supported:
The following arguments are expected:

* `host_project` - (Required) The host project ID.
* `project` - (Required) The ID of the project that will serve as a Shared VPC host project

* `service_project` - (Required) The service project ID.
30 changes: 20 additions & 10 deletions website/docs/r/compute_shared_vpc_service_project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,36 @@ layout: "google"
page_title: "Google: google_compute_shared_vpc_service_project"
sidebar_current: "docs-google-compute-shared-vpc-service-project"
description: |-
Allows enabling and disabling Shared VPC for a service Google Cloud Platform project.
Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a service project.
---

# google\_compute\_shared\_vpc\_service\_project
# google_compute_shared_vpc_service_project

Allows enabling and disabling Shared VPC for a service Google Cloud Platform project. For more information see
[the official documentation](https://cloud.google.com/compute/docs/shared-vpc)
and
[API](https://cloud.google.com/compute/docs/reference/latest/projects).
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 service project associated
with a given 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".

## Example Usage

```hcl
resource "google_compute_shared_vpc_host_project" "host" {
project = "your-project-id"
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`](/docs/providers/google/r/compute_shared_vpc_host_project.html).

## Argument Reference

The following arguments are supported:
The following arguments are expected:

* `host_project` - (Required) The ID of a host project to associate.

* `project` - (Required) The host project ID.
* `service_project` - (Required) The ID of the project that will serve as a Shared VPC service project.

0 comments on commit 182f878

Please sign in to comment.