Skip to content

Commit 79414d8

Browse files
dhruv-23101998yerniyazN
authored andcommitted
Adding IP Collection & IPv6 GCE Endpoint to Subnetwork Resource (GoogleCloudPlatform#13271)
1 parent 897ffa7 commit 79414d8

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

mmv1/products/compute/Subnetwork.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ examples:
140140
vars:
141141
subnetwork_name: 'subnet-ipv6-only'
142142
network_name: 'network-ipv6-only'
143+
- name: 'subnetwork_with_subnet_mode_pdp'
144+
primary_resource_id: 'subnetwork-with-subnet-mode-pdp'
145+
exclude_docs: true
146+
vars:
147+
subnetwork_name: 'subnet-mode-pdp-subnet'
148+
network_name: 'network-byoipv6-external'
149+
ip_collection_url: '"projects/tf-static-byoip/regions/us-central1/publicDelegatedPrefixes/tf-test-subnet-mode-pdp"'
150+
test_vars_overrides:
151+
ip_collection_url: '"projects/tf-static-byoip/regions/us-central1/publicDelegatedPrefixes/tf-test-subnet-mode-pdp"'
143152
- name: 'subnetwork_ipv6_only_external'
144153
primary_resource_id: 'subnetwork-ipv6-only'
145154
exclude_docs: true
@@ -457,6 +466,31 @@ properties:
457466
description: |
458467
The range of external IPv6 addresses that are owned by this subnetwork.
459468
default_from_api: true
469+
- name: 'ipCollection'
470+
type: String
471+
ignore_read: true
472+
description: |
473+
Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP
474+
in EXTERNAL_IPV6_SUBNETWORK_CREATION mode.
475+
Use one of the following formats to specify a sub-PDP when creating an
476+
IPv6 NetLB forwarding rule using BYOIP:
477+
Full resource URL, as in:
478+
* `https://www.googleapis.com/compute/v1/projects/{{projectId}}/regions/{{region}}/publicDelegatedPrefixes/{{sub-pdp-name}}`
479+
Partial URL, as in:
480+
* `projects/{{projectId}}/regions/region/publicDelegatedPrefixes/{{sub-pdp-name}}`
481+
* `regions/{{region}}/publicDelegatedPrefixes/{{sub-pdp-name}}`
482+
- name: 'ipv6GceEndpoint'
483+
type: Enum
484+
description: |
485+
Possible endpoints of this subnetwork. It can be one of the following:
486+
* VM_ONLY: The subnetwork can be used for creating instances and IPv6 addresses with VM endpoint type. Such a subnetwork
487+
gets external IPv6 ranges from a public delegated prefix and cannot be used to create NetLb.
488+
* VM_AND_FR: The subnetwork can be used for creating both VM instances and Forwarding Rules. It can also be used to reserve
489+
IPv6 addresses with both VM and FR endpoint types. Such a subnetwork gets its IPv6 range from Google IP Pool directly.
490+
output: true
491+
enum_values:
492+
- 'VM_AND_FR'
493+
- 'VM_ONLY'
460494
- name: 'allowSubnetCidrRoutesOverlap'
461495
type: Boolean
462496
description: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "google_compute_subnetwork" "{{$.PrimaryResourceId}}" {
2+
name = "{{index $.Vars "subnetwork_name"}}"
3+
region = "us-central1"
4+
network = google_compute_network.custom-test-network.id
5+
stack_type = "IPV6_ONLY"
6+
ipv6_access_type = "EXTERNAL"
7+
ip_collection = "{{index $.Vars "ip_collection_url"}}"
8+
}
9+
10+
resource "google_compute_network" "custom-test-network" {
11+
name = "{{index $.Vars "network_name"}}"
12+
auto_create_subnetworks = false
13+
}

0 commit comments

Comments
 (0)