Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IPV6 for HA VPN. #7525

Merged
merged 4 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions mmv1/products/compute/VpnGateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ examples:
vars:
ha_vpn_gateway1_name: "ha-vpn-1"
network1_name: "network1"
- !ruby/object:Provider::Terraform::Examples
name: "ha_vpn_gateway_ipv6"
primary_resource_id: "ha_gateway1"
vars:
ha_vpn_gateway1_name: "ha-vpn-1"
network1_name: "network1"
- !ruby/object:Provider::Terraform::Examples
name: "ha_vpn_gateway_gcp_to_gcp"
primary_resource_id: "ha_gateway1"
Expand Down Expand Up @@ -126,6 +132,17 @@ properties:
The network this VPN gateway is accepting traffic for.
required: true
immutable: true
- !ruby/object:Api::Type::Enum
name: 'stack_type'
600lyy marked this conversation as resolved.
Show resolved Hide resolved
description: |
The stack type for this VPN gateway to identify the IP protocols that are enbaled.
If not specified, IPV4_ONLY will be used.
default_value: :IPV4_ONLY
values:
- :IPV4_ONLY
- :IPV4_IPV6
immutable: true
ignore_read: true
600lyy marked this conversation as resolved.
Show resolved Hide resolved
- !ruby/object:Api::Type::Array
name: 'vpnInterfaces'
description: |
Expand Down
11 changes: 11 additions & 0 deletions mmv1/templates/terraform/examples/ha_vpn_gateway_ipv6.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "google_compute_ha_vpn_gateway" "ha_gateway1" {
region = "us-central1"
name = "<%= ctx[:vars]['ha_vpn_gateway1_name'] %>"
network = google_compute_network.network1.id
stack_type = "IPV4_IPV6"
}

resource "google_compute_network" "network1" {
name = "<%= ctx[:vars]['network1_name'] %>"
auto_create_subnetworks = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ func TestAccDataSourceComputeHaVpnGateway(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccDataSourceComputeHaVpnGatewayConfig(gwName),
Check: checkDataSourceStateMatchesResourceState("data.google_compute_ha_vpn_gateway.ha_gateway", "google_compute_ha_vpn_gateway.ha_gateway"),
// Check: checkDataSourceStateMatchesResourceState("data.google_compute_ha_vpn_gateway.ha_gateway", "google_compute_ha_vpn_gateway.ha_gateway"),
Check: resource.ComposeTestCheckFunc(
checkDataSourceStateMatchesResourceStateWithIgnores(
"data.google_compute_ha_vpn_gateway.ha_gateway",
"google_compute_ha_vpn_gateway.ha_gateway",
map[string]struct{}{"stack_type": {}},
),
),
},
},
})
Expand Down