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

Promote HA VPN to GA #2607

Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions .changelog/4115.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```release-note:note
compute: added a deprecation warning to `google_compute_vpn_gateway`
```
```release-note:enhancement
compute: promoted `google_compute_ha_vpn_gateway` to GA
```
```release-note:enhancement
compute: promoted `google_compute_external_vpn_gateway` to GA
```
```release-note:enhancement
compute: promoted HA VPN fields in `google_compute_vpn_tunnel` to GA
```
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestAccComputeExternalVpnGateway_externalVpnGatewayExample(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
ExternalProviders: map[string]resource.ExternalProvider{
"random": {},
},
Expand All @@ -42,21 +42,24 @@ func TestAccComputeExternalVpnGateway_externalVpnGatewayExample(t *testing.T) {
{
Config: testAccComputeExternalVpnGateway_externalVpnGatewayExample(context),
},
{
ResourceName: "google_compute_external_vpn_gateway.external_gateway",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccComputeExternalVpnGateway_externalVpnGatewayExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_ha_vpn_gateway" "ha_gateway" {
provider = google-beta
region = "us-central1"
name = "tf-test-ha-vpn%{random_suffix}"
network = google_compute_network.network.id
}

resource "google_compute_external_vpn_gateway" "external_gateway" {
provider = google-beta
name = "tf-test-external-gateway%{random_suffix}"
redundancy_type = "SINGLE_IP_INTERNALLY_REDUNDANT"
description = "An externally managed VPN gateway"
Expand All @@ -67,30 +70,26 @@ resource "google_compute_external_vpn_gateway" "external_gateway" {
}

resource "google_compute_network" "network" {
provider = google-beta
name = "network%{random_suffix}"
routing_mode = "GLOBAL"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "network_subnet1" {
provider = google-beta
name = "ha-vpn-subnet-1"
ip_cidr_range = "10.0.1.0/24"
region = "us-central1"
network = google_compute_network.network.id
}

resource "google_compute_subnetwork" "network_subnet2" {
provider = google-beta
name = "ha-vpn-subnet-2"
ip_cidr_range = "10.0.2.0/24"
region = "us-west1"
network = google_compute_network.network.id
}

resource "google_compute_router" "router1" {
provider = google-beta
name = "ha-vpn-router1"
network = google_compute_network.network.name
bgp {
Expand All @@ -99,7 +98,6 @@ resource "google_compute_router" "router1" {
}

resource "google_compute_vpn_tunnel" "tunnel1" {
provider = google-beta
name = "ha-vpn-tunnel1"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway.id
Expand All @@ -111,7 +109,6 @@ resource "google_compute_vpn_tunnel" "tunnel1" {
}

resource "google_compute_vpn_tunnel" "tunnel2" {
provider = google-beta
name = "ha-vpn-tunnel2"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway.id
Expand All @@ -123,7 +120,6 @@ resource "google_compute_vpn_tunnel" "tunnel2" {
}

resource "google_compute_router_interface" "router1_interface1" {
provider = google-beta
name = "router1-interface1"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -132,7 +128,6 @@ resource "google_compute_router_interface" "router1_interface1" {
}

resource "google_compute_router_peer" "router1_peer1" {
provider = google-beta
name = "router1-peer1"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -143,7 +138,6 @@ resource "google_compute_router_peer" "router1_peer1" {
}

resource "google_compute_router_interface" "router1_interface2" {
provider = google-beta
name = "router1-interface2"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -152,7 +146,6 @@ resource "google_compute_router_interface" "router1_interface2" {
}

resource "google_compute_router_peer" "router1_peer2" {
provider = google-beta
name = "router1-peer2"
router = google_compute_router.router1.name
region = "us-central1"
Expand Down
40 changes: 14 additions & 26 deletions google-beta/resource_compute_ha_vpn_gateway_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestAccComputeHaVpnGateway_haVpnGatewayBasicExample(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
ExternalProviders: map[string]resource.ExternalProvider{
"random": {},
},
Expand All @@ -41,21 +41,25 @@ func TestAccComputeHaVpnGateway_haVpnGatewayBasicExample(t *testing.T) {
{
Config: testAccComputeHaVpnGateway_haVpnGatewayBasicExample(context),
},
{
ResourceName: "google_compute_ha_vpn_gateway.ha_gateway1",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"network", "region"},
},
},
})
}

func testAccComputeHaVpnGateway_haVpnGatewayBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_ha_vpn_gateway" "ha_gateway1" {
provider = google-beta
region = "us-central1"
name = "tf-test-ha-vpn-1%{random_suffix}"
network = google_compute_network.network1.id
}

resource "google_compute_network" "network1" {
provider = google-beta
name = "network1%{random_suffix}"
auto_create_subnetworks = false
}
Expand All @@ -72,7 +76,7 @@ func TestAccComputeHaVpnGateway_haVpnGatewayGcpToGcpExample(t *testing.T) {

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
ExternalProviders: map[string]resource.ExternalProvider{
"random": {},
},
Expand All @@ -81,74 +85,71 @@ func TestAccComputeHaVpnGateway_haVpnGatewayGcpToGcpExample(t *testing.T) {
{
Config: testAccComputeHaVpnGateway_haVpnGatewayGcpToGcpExample(context),
},
{
ResourceName: "google_compute_ha_vpn_gateway.ha_gateway1",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"network", "region"},
},
},
})
}

func testAccComputeHaVpnGateway_haVpnGatewayGcpToGcpExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_ha_vpn_gateway" "ha_gateway1" {
provider = google-beta
region = "us-central1"
name = "tf-test-ha-vpn-1%{random_suffix}"
network = google_compute_network.network1.id
}

resource "google_compute_ha_vpn_gateway" "ha_gateway2" {
provider = google-beta
region = "us-central1"
name = "tf-test-ha-vpn-2%{random_suffix}"
network = google_compute_network.network2.id
}

resource "google_compute_network" "network1" {
provider = google-beta
name = "network1%{random_suffix}"
routing_mode = "GLOBAL"
auto_create_subnetworks = false
}

resource "google_compute_network" "network2" {
provider = google-beta
name = "network2%{random_suffix}"
routing_mode = "GLOBAL"
auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "network1_subnet1" {
provider = google-beta
name = "ha-vpn-subnet-1"
ip_cidr_range = "10.0.1.0/24"
region = "us-central1"
network = google_compute_network.network1.id
}

resource "google_compute_subnetwork" "network1_subnet2" {
provider = google-beta
name = "ha-vpn-subnet-2"
ip_cidr_range = "10.0.2.0/24"
region = "us-west1"
network = google_compute_network.network1.id
}

resource "google_compute_subnetwork" "network2_subnet1" {
provider = google-beta
name = "ha-vpn-subnet-3"
ip_cidr_range = "192.168.1.0/24"
region = "us-central1"
network = google_compute_network.network2.id
}

resource "google_compute_subnetwork" "network2_subnet2" {
provider = google-beta
name = "ha-vpn-subnet-4"
ip_cidr_range = "192.168.2.0/24"
region = "us-east1"
network = google_compute_network.network2.id
}

resource "google_compute_router" "router1" {
provider = google-beta
name = "ha-vpn-router1"
network = google_compute_network.network1.name
bgp {
Expand All @@ -157,7 +158,6 @@ resource "google_compute_router" "router1" {
}

resource "google_compute_router" "router2" {
provider = google-beta
name = "ha-vpn-router2"
network = google_compute_network.network2.name
bgp {
Expand All @@ -166,7 +166,6 @@ resource "google_compute_router" "router2" {
}

resource "google_compute_vpn_tunnel" "tunnel1" {
provider = google-beta
name = "ha-vpn-tunnel1"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway1.id
Expand All @@ -177,7 +176,6 @@ resource "google_compute_vpn_tunnel" "tunnel1" {
}

resource "google_compute_vpn_tunnel" "tunnel2" {
provider = google-beta
name = "ha-vpn-tunnel2"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway1.id
Expand All @@ -188,7 +186,6 @@ resource "google_compute_vpn_tunnel" "tunnel2" {
}

resource "google_compute_vpn_tunnel" "tunnel3" {
provider = google-beta
name = "ha-vpn-tunnel3"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway2.id
Expand All @@ -199,7 +196,6 @@ resource "google_compute_vpn_tunnel" "tunnel3" {
}

resource "google_compute_vpn_tunnel" "tunnel4" {
provider = google-beta
name = "ha-vpn-tunnel4"
region = "us-central1"
vpn_gateway = google_compute_ha_vpn_gateway.ha_gateway2.id
Expand All @@ -210,7 +206,6 @@ resource "google_compute_vpn_tunnel" "tunnel4" {
}

resource "google_compute_router_interface" "router1_interface1" {
provider = google-beta
name = "router1-interface1"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -219,7 +214,6 @@ resource "google_compute_router_interface" "router1_interface1" {
}

resource "google_compute_router_peer" "router1_peer1" {
provider = google-beta
name = "router1-peer1"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -230,7 +224,6 @@ resource "google_compute_router_peer" "router1_peer1" {
}

resource "google_compute_router_interface" "router1_interface2" {
provider = google-beta
name = "router1-interface2"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -239,7 +232,6 @@ resource "google_compute_router_interface" "router1_interface2" {
}

resource "google_compute_router_peer" "router1_peer2" {
provider = google-beta
name = "router1-peer2"
router = google_compute_router.router1.name
region = "us-central1"
Expand All @@ -250,7 +242,6 @@ resource "google_compute_router_peer" "router1_peer2" {
}

resource "google_compute_router_interface" "router2_interface1" {
provider = google-beta
name = "router2-interface1"
router = google_compute_router.router2.name
region = "us-central1"
Expand All @@ -259,7 +250,6 @@ resource "google_compute_router_interface" "router2_interface1" {
}

resource "google_compute_router_peer" "router2_peer1" {
provider = google-beta
name = "router2-peer1"
router = google_compute_router.router2.name
region = "us-central1"
Expand All @@ -270,7 +260,6 @@ resource "google_compute_router_peer" "router2_peer1" {
}

resource "google_compute_router_interface" "router2_interface2" {
provider = google-beta
name = "router2-interface2"
router = google_compute_router.router2.name
region = "us-central1"
Expand All @@ -279,7 +268,6 @@ resource "google_compute_router_interface" "router2_interface2" {
}

resource "google_compute_router_peer" "router2_peer2" {
provider = google-beta
name = "router2-peer2"
router = google_compute_router.router2.name
region = "us-central1"
Expand Down
2 changes: 2 additions & 0 deletions google-beta/resource_compute_vpn_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Only IPv4 is supported.`,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
Description: `URL of the peer side external VPN gateway to which this VPN tunnel is connected.`,
ExactlyOneOf: []string{"peer_external_gateway", "peer_gcp_gateway"},
},
"peer_external_gateway_interface": {
Type: schema.TypeInt,
Expand All @@ -223,6 +224,7 @@ Only IPv4 is supported.`,
If provided, the VPN tunnel will automatically use the same vpn_gateway_interface
ID in the peer GCP VPN gateway.
This field must reference a 'google_compute_ha_vpn_gateway' resource.`,
ExactlyOneOf: []string{"peer_external_gateway", "peer_gcp_gateway"},
},
"peer_ip": {
Type: schema.TypeString,
Expand Down
Loading