|
| 1 | +/** |
| 2 | + * Copyright 2022 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" "vpc_network_ipv6" { |
| 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 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.vpc_network_ipv6.id |
| 33 | +} |
| 34 | +# [END subnet_dual_stack] |
| 35 | + |
| 36 | +# [START 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.vpc_network_ipv6.id |
| 41 | + stack_type = "IPV6_ONLY" |
| 42 | + ipv6_access_type = "INTERNAL" |
| 43 | +} |
| 44 | +# [END subnet_ipv6_only] |
0 commit comments