Skip to content

Commit

Permalink
Revert the promotion of Port Mapping NEGs from GA to Beta (#11854) (#…
Browse files Browse the repository at this point in the history
…8305)

[upstream:2d34af8bcf47b390ede98ace828c98e80cb3acd0]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and ScottSuarez committed Sep 30, 2024
1 parent 82d97bc commit 780b3e6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/11854.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: promoted `client_destination_port` and `instance` fields in `google_compute_region_network_endpoint` resource to GA (revert)
```
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ func resourceComputeRegionNetworkEndpointDelete(d *schema.ResourceData, meta int
if fqdnProp != "" {
toDelete["fqdn"] = fqdnProp
}

// Instance
instanceProp, err := expandNestedComputeRegionNetworkEndpointInstance(d.Get("instance"), d, config)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ func TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupPortmapE

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
CheckDestroy: testAccCheckComputeRegionNetworkEndpointGroupDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -543,17 +543,20 @@ resource "google_compute_region_network_endpoint_group" "region_network_endpoint
subnetwork = google_compute_subnetwork.default.id
network_endpoint_type = "GCE_VM_IP_PORTMAP"
provider = google-beta
}
resource "google_compute_network" "default" {
name = "network%{random_suffix}"
provider = google-beta
}
resource "google_compute_subnetwork" "default" {
name = "subnetwork%{random_suffix}"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = google_compute_network.default.id
provider = google-beta
}
`, context)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestAccComputeRegionNetworkEndpoint_regionNetworkEndpointPortmapExample(t *

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
Steps: []resource.TestStep{
{
Config: testAccComputeRegionNetworkEndpoint_regionNetworkEndpointPortmapExample(context),
Expand All @@ -185,13 +185,15 @@ func testAccComputeRegionNetworkEndpoint_regionNetworkEndpointPortmapNoEndpointE
resource "google_compute_network" "default" {
name = "network%{random_suffix}"
auto_create_subnetworks = false
provider = google-beta
}
resource "google_compute_subnetwork" "default" {
name = "subnetwork%{random_suffix}"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = google_compute_network.default.id
provider = google-beta
}
resource "google_compute_region_network_endpoint_group" default {
Expand All @@ -201,11 +203,13 @@ resource "google_compute_region_network_endpoint_group" default {
subnetwork = google_compute_subnetwork.default.id
network_endpoint_type = "GCE_VM_IP_PORTMAP"
provider = google-beta
}
data "google_compute_image" "my_image" {
family = "debian-11"
project = "debian-cloud"
provider = google-beta
}
resource "google_compute_instance" "default" {
Expand All @@ -224,6 +228,7 @@ resource "google_compute_instance" "default" {
access_config {
}
}
provider = google-beta
}
`, context)
}
Expand All @@ -237,6 +242,7 @@ resource "google_compute_region_network_endpoint" "region_network_endpoint_portm
port = 80
ip_address = google_compute_instance.default.network_interface[0].network_ip
client_destination_port = 8080
provider = google-beta
}
`, context) + testAccComputeRegionNetworkEndpoint_regionNetworkEndpointPortmapNoEndpointExample(context)
}
Expand Down
10 changes: 8 additions & 2 deletions website/docs/r/compute_region_network_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ resource "google_compute_network" "default" {
resource "google_compute_network" "default" {
name = "network"
auto_create_subnetworks = false
provider = google-beta
}
resource "google_compute_subnetwork" "default" {
name = "subnetwork"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = google_compute_network.default.id
provider = google-beta
}
resource "google_compute_region_network_endpoint_group" default {
Expand All @@ -118,6 +120,7 @@ resource "google_compute_region_network_endpoint_group" default {
subnetwork = google_compute_subnetwork.default.id
network_endpoint_type = "GCE_VM_IP_PORTMAP"
provider = google-beta
}
resource "google_compute_region_network_endpoint" "region_network_endpoint_portmap" {
Expand All @@ -127,11 +130,13 @@ resource "google_compute_region_network_endpoint" "region_network_endpoint_portm
port = 80
ip_address = google_compute_instance.default.network_interface[0].network_ip
client_destination_port = 8080
provider = google-beta
}
data "google_compute_image" "my_image" {
family = "debian-11"
project = "debian-cloud"
provider = google-beta
}
resource "google_compute_instance" "default" {
Expand All @@ -150,6 +155,7 @@ resource "google_compute_instance" "default" {
access_config {
}
}
provider = google-beta
}
```

Expand Down Expand Up @@ -181,11 +187,11 @@ The following arguments are supported:
This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.

* `client_destination_port` -
(Optional)
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
Client destination port for the `GCE_VM_IP_PORTMAP` NEG.

* `instance` -
(Optional)
(Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
The name for a specific VM instance that the IP address belongs to.
This is required for network endpoints of type GCE_VM_IP_PORTMAP.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,20 @@ resource "google_compute_region_network_endpoint_group" "region_network_endpoint
subnetwork = google_compute_subnetwork.default.id
network_endpoint_type = "GCE_VM_IP_PORTMAP"
provider = google-beta
}
resource "google_compute_network" "default" {
name = "network"
provider = google-beta
}
resource "google_compute_subnetwork" "default" {
name = "subnetwork"
ip_cidr_range = "10.0.0.0/16"
region = "us-central1"
network = google_compute_network.default.id
provider = google-beta
}
```

Expand Down

0 comments on commit 780b3e6

Please sign in to comment.