Skip to content

Commit 2624a8d

Browse files
jarzynskilaglasnt
andauthored
Add samples for dual-stack and ipv6-only subnet creation (#891)
* Prepared network_ipv6 for inclusion in C.G.C. documentation * ci: skip tests for complex sample * use standard naming for singleton resource * correct region tags * new samples get current date --------- Co-authored-by: Katie McLaughlin <[email protected]>
1 parent 401d64d commit 2624a8d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

vpc/network_ipv6/main.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START vpc_ipv6_internal]
18+
resource "google_compute_network" "default" {
19+
name = "vpc-network-ipv6"
20+
auto_create_subnetworks = false
21+
enable_ula_internal_ipv6 = true
22+
}
23+
# [END vpc_ipv6_internal]
24+
25+
# [START vpc_subnet_dual_stack]
26+
resource "google_compute_subnetwork" "subnet_dual_stack" {
27+
name = "subnet-dual-stack"
28+
ip_cidr_range = "10.0.0.0/22"
29+
region = "us-west2"
30+
stack_type = "IPV4_IPV6"
31+
ipv6_access_type = "INTERNAL"
32+
network = google_compute_network.default.id
33+
}
34+
# [END vpc_subnet_dual_stack]
35+
36+
# [START vpc_subnet_ipv6_only]
37+
resource "google_compute_subnetwork" "subnet_ipv6_only" {
38+
name = "subnet-ipv6-only"
39+
region = "us-central1"
40+
network = google_compute_network.default.id
41+
stack_type = "IPV6_ONLY"
42+
ipv6_access_type = "INTERNAL"
43+
}
44+
# [END vpc_subnet_ipv6_only]

vpc/network_ipv6/test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: vpc_network_ipv6
19+
spec:
20+
skip: true

0 commit comments

Comments
 (0)