From 92adc160c71d700fa4a28af9534bcb191621e0e9 Mon Sep 17 00:00:00 2001 From: alkobi-google Date: Mon, 16 Dec 2024 11:05:43 +0000 Subject: [PATCH 1/2] Promote VPC Flow Logs to GA Signed-off-by: alkobi-google --- .../networkmanagement/VpcFlowLogsConfig.yaml | 5 ---- ...low_logs_config_interconnect_basic.tf.tmpl | 5 ---- ...flow_logs_config_interconnect_full.tf.tmpl | 5 ---- ...ent_vpc_flow_logs_config_vpn_basic.tf.tmpl | 10 -------- ...ment_vpc_flow_logs_config_vpn_full.tf.tmpl | 10 -------- ...nagement_vpc_flow_logs_config_test.go.tmpl | 24 ------------------- 6 files changed, 59 deletions(-) diff --git a/mmv1/products/networkmanagement/VpcFlowLogsConfig.yaml b/mmv1/products/networkmanagement/VpcFlowLogsConfig.yaml index e0f438fb8f49..79f269ee11be 100644 --- a/mmv1/products/networkmanagement/VpcFlowLogsConfig.yaml +++ b/mmv1/products/networkmanagement/VpcFlowLogsConfig.yaml @@ -16,7 +16,6 @@ name: 'VpcFlowLogsConfig' description: VPC Flow Logs Config is a resource that lets you configure Flow Logs for VPC, Interconnect attachments or VPN Tunnels. -min_version: beta id_format: 'projects/{{project}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}' base_url: 'projects/{{project}}/locations/{{location}}/vpcFlowLogsConfigs' self_link: 'projects/{{project}}/locations/{{location}}/vpcFlowLogsConfigs/{{vpc_flow_logs_config_id}}' @@ -41,7 +40,6 @@ custom_code: examples: - name: 'network_management_vpc_flow_logs_config_interconnect_full' primary_resource_id: 'interconnect-test' - min_version: 'beta' vars: network_name: 'full-interconnect-test-network' router_name: 'full-interconnect-test-router' @@ -49,7 +47,6 @@ examples: interconnect_attachment_name: 'full-interconnect-test-id' - name: 'network_management_vpc_flow_logs_config_interconnect_basic' primary_resource_id: 'interconnect-test' - min_version: 'beta' vars: network_name: 'basic-interconnect-test-network' router_name: 'basic-interconnect-test-router' @@ -57,7 +54,6 @@ examples: interconnect_attachment_name: 'basic-interconnect-test-id' - name: 'network_management_vpc_flow_logs_config_vpn_basic' primary_resource_id: 'vpn-test' - min_version: 'beta' vars: network_name: 'basic-test-network' vpn_tunnel_name: 'basic-test-tunnel' @@ -70,7 +66,6 @@ examples: vpc_flow_logs_config_id: 'basic-test-id' - name: 'network_management_vpc_flow_logs_config_vpn_full' primary_resource_id: 'vpn-test' - min_version: 'beta' vars: network_name: 'full-test-network' vpn_tunnel_name: 'full-test-tunnel' diff --git a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_basic.tf.tmpl b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_basic.tf.tmpl index 38349b84fd91..1ded9a12a0e1 100644 --- a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_basic.tf.tmpl @@ -1,21 +1,17 @@ data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId}}" { - provider = google-beta vpc_flow_logs_config_id = "{{index $.Vars "vpc_flow_logs_config_id"}}" location = "global" interconnect_attachment = "projects/${data.google_project.project.number}/regions/us-east4/interconnectAttachments/${google_compute_interconnect_attachment.attachment.name}" } resource "google_compute_network" "network" { - provider = google-beta name = "{{index $.Vars "network_name"}}" } resource "google_compute_router" "router" { - provider = google-beta name = "{{index $.Vars "router_name"}}" network = google_compute_network.network.name bgp { @@ -24,7 +20,6 @@ resource "google_compute_router" "router" { } resource "google_compute_interconnect_attachment" "attachment" { - provider = google-beta name = "{{index $.Vars "interconnect_attachment_name"}}" edge_availability_domain = "AVAILABILITY_DOMAIN_1" type = "PARTNER" diff --git a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_full.tf.tmpl b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_full.tf.tmpl index 2c70a3b3585b..fbc87c248f6e 100644 --- a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_interconnect_full.tf.tmpl @@ -1,9 +1,7 @@ data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId}}" { - provider = google-beta vpc_flow_logs_config_id = "{{index $.Vars "vpc_flow_logs_config_id"}}" location = "global" interconnect_attachment = "projects/${data.google_project.project.number}/regions/us-east4/interconnectAttachments/${google_compute_interconnect_attachment.attachment.name}" @@ -15,12 +13,10 @@ resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId } resource "google_compute_network" "network" { - provider = google-beta name = "{{index $.Vars "network_name"}}" } resource "google_compute_router" "router" { - provider = google-beta name = "{{index $.Vars "router_name"}}" network = google_compute_network.network.name bgp { @@ -29,7 +25,6 @@ resource "google_compute_router" "router" { } resource "google_compute_interconnect_attachment" "attachment" { - provider = google-beta name = "{{index $.Vars "interconnect_attachment_name"}}" edge_availability_domain = "AVAILABILITY_DOMAIN_1" type = "PARTNER" diff --git a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_basic.tf.tmpl b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_basic.tf.tmpl index b510af95cf91..d4fdb58fc2d6 100644 --- a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_basic.tf.tmpl @@ -1,16 +1,13 @@ data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId}}" { - provider = google-beta vpc_flow_logs_config_id = "{{index $.Vars "vpc_flow_logs_config_id"}}" location = "global" vpn_tunnel = "projects/${data.google_project.project.number}/regions/us-central1/vpnTunnels/${google_compute_vpn_tunnel.tunnel.name}" } resource "google_compute_vpn_tunnel" "tunnel" { - provider = google-beta name = "{{index $.Vars "vpn_tunnel_name"}}" peer_ip = "15.0.0.120" shared_secret = "a secret message" @@ -24,23 +21,19 @@ resource "google_compute_vpn_tunnel" "tunnel" { } resource "google_compute_vpn_gateway" "target_gateway" { - provider = google-beta name = "{{index $.Vars "target_vpn_gateway_name"}}" network = google_compute_network.network.id } resource "google_compute_network" "network" { - provider = google-beta name = "{{index $.Vars "network_name"}}" } resource "google_compute_address" "vpn_static_ip" { - provider = google-beta name = "{{index $.Vars "address_name"}}" } resource "google_compute_forwarding_rule" "fr_esp" { - provider = google-beta name = "{{index $.Vars "esp_forwarding_rule_name"}}" ip_protocol = "ESP" ip_address = google_compute_address.vpn_static_ip.address @@ -48,7 +41,6 @@ resource "google_compute_forwarding_rule" "fr_esp" { } resource "google_compute_forwarding_rule" "fr_udp500" { - provider = google-beta name = "{{index $.Vars "udp500_forwarding_rule_name"}}" ip_protocol = "UDP" port_range = "500" @@ -57,7 +49,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" { } resource "google_compute_forwarding_rule" "fr_udp4500" { - provider = google-beta name = "{{index $.Vars "udp4500_forwarding_rule_name"}}" ip_protocol = "UDP" port_range = "4500" @@ -66,7 +57,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" { } resource "google_compute_route" "route" { - provider = google-beta name = "{{index $.Vars "route_name"}}" network = google_compute_network.network.name dest_range = "15.0.0.0/24" diff --git a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_full.tf.tmpl b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_full.tf.tmpl index eaffc485af90..90de9e6bddf8 100644 --- a/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_full.tf.tmpl +++ b/mmv1/templates/terraform/examples/network_management_vpc_flow_logs_config_vpn_full.tf.tmpl @@ -1,9 +1,7 @@ data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId}}" { - provider = google-beta vpc_flow_logs_config_id = "{{index $.Vars "vpc_flow_logs_config_id"}}" location = "global" vpn_tunnel = "projects/${data.google_project.project.number}/regions/us-central1/vpnTunnels/${google_compute_vpn_tunnel.tunnel.name}" @@ -15,7 +13,6 @@ resource "google_network_management_vpc_flow_logs_config" "{{$.PrimaryResourceId } resource "google_compute_vpn_tunnel" "tunnel" { - provider = google-beta name = "{{index $.Vars "vpn_tunnel_name"}}" peer_ip = "15.0.0.120" shared_secret = "a secret message" @@ -29,23 +26,19 @@ resource "google_compute_vpn_tunnel" "tunnel" { } resource "google_compute_vpn_gateway" "target_gateway" { - provider = google-beta name = "{{index $.Vars "target_vpn_gateway_name"}}" network = google_compute_network.network.id } resource "google_compute_network" "network" { - provider = google-beta name = "{{index $.Vars "network_name"}}" } resource "google_compute_address" "vpn_static_ip" { - provider = google-beta name = "{{index $.Vars "address_name"}}" } resource "google_compute_forwarding_rule" "fr_esp" { - provider = google-beta name = "{{index $.Vars "esp_forwarding_rule_name"}}" ip_protocol = "ESP" ip_address = google_compute_address.vpn_static_ip.address @@ -53,7 +46,6 @@ resource "google_compute_forwarding_rule" "fr_esp" { } resource "google_compute_forwarding_rule" "fr_udp500" { - provider = google-beta name = "{{index $.Vars "udp500_forwarding_rule_name"}}" ip_protocol = "UDP" port_range = "500" @@ -62,7 +54,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" { } resource "google_compute_forwarding_rule" "fr_udp4500" { - provider = google-beta name = "{{index $.Vars "udp4500_forwarding_rule_name"}}" ip_protocol = "UDP" port_range = "4500" @@ -71,7 +62,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" { } resource "google_compute_route" "route" { - provider = google-beta name = "{{index $.Vars "route_name"}}" network = google_compute_network.network.name dest_range = "15.0.0.0/24" diff --git a/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl b/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl index 70795d254407..90828e425929 100644 --- a/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl +++ b/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl @@ -1,5 +1,4 @@ package networkmanagement_test -{{- if ne $.TargetVersionName "ga" }} import ( "fmt" @@ -46,23 +45,19 @@ func TestAccNetworkManagementVpcFlowLogsConfig_updateInterconnect(t *testing.T) func testAccNetworkManagementVpcFlowLogsConfig_fullInterconnect(context map[string]interface{}) string { return acctest.Nprintf(` data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "interconnect-test" { - provider = google-beta vpc_flow_logs_config_id = "tf-test-full-interconnect-test-id%{random_suffix}" location = "global" interconnect_attachment = "projects/${data.google_project.project.number}/regions/us-east4/interconnectAttachments/${google_compute_interconnect_attachment.attachment.name}" } resource "google_compute_network" "network" { - provider = google-beta name = "tf-test-full-interconnect-test-network%{random_suffix}" } resource "google_compute_router" "router" { - provider = google-beta name = "tf-test-full-interconnect-test-router%{random_suffix}" network = google_compute_network.network.name bgp { @@ -71,7 +66,6 @@ resource "google_compute_router" "router" { } resource "google_compute_interconnect_attachment" "attachment" { - provider = google-beta name = "tf-test-full-interconnect-test-id%{random_suffix}" edge_availability_domain = "AVAILABILITY_DOMAIN_1" type = "PARTNER" @@ -85,11 +79,9 @@ resource "google_compute_interconnect_attachment" "attachment" { func testAccNetworkManagementVpcFlowLogsConfig_updateInterconnect(context map[string]interface{}) string { return acctest.Nprintf(` data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "interconnect-test" { - provider = google-beta vpc_flow_logs_config_id = "tf-test-full-interconnect-test-id%{random_suffix}" location = "global" interconnect_attachment = "projects/${data.google_project.project.number}/regions/us-east4/interconnectAttachments/${google_compute_interconnect_attachment.attachment.name}" @@ -101,12 +93,10 @@ resource "google_network_management_vpc_flow_logs_config" "interconnect-test" { } resource "google_compute_network" "network" { - provider = google-beta name = "tf-test-full-interconnect-test-network%{random_suffix}" } resource "google_compute_router" "router" { - provider = google-beta name = "tf-test-full-interconnect-test-router%{random_suffix}" network = google_compute_network.network.name bgp { @@ -115,7 +105,6 @@ resource "google_compute_router" "router" { } resource "google_compute_interconnect_attachment" "attachment" { - provider = google-beta name = "tf-test-full-interconnect-test-id%{random_suffix}" edge_availability_domain = "AVAILABILITY_DOMAIN_1" type = "PARTNER" @@ -163,11 +152,9 @@ func TestAccNetworkManagementVpcFlowLogsConfig_updateVpn(t *testing.T) { func testAccNetworkManagementVpcFlowLogsConfig_fullVpn(context map[string]interface{}) string { vpcFlowLogsCfg := acctest.Nprintf(` data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "example" { - provider = google-beta vpc_flow_logs_config_id = "id-example-%{random_suffix}" location = "global" vpn_tunnel = "projects/${data.google_project.project.number}/regions/us-central1/vpnTunnels/${google_compute_vpn_tunnel.tunnel.name}" @@ -179,11 +166,9 @@ resource "google_network_management_vpc_flow_logs_config" "example" { func testAccNetworkManagementVpcFlowLogsConfig_updateVpn(context map[string]interface{}) string { vpcFlowLogsCfg := acctest.Nprintf(` data "google_project" "project" { - provider = google-beta } resource "google_network_management_vpc_flow_logs_config" "example" { - provider = google-beta vpc_flow_logs_config_id = "id-example-%{random_suffix}" location = "global" vpn_tunnel = "projects/${data.google_project.project.number}/regions/us-central1/vpnTunnels/${google_compute_vpn_tunnel.tunnel.name}" @@ -200,7 +185,6 @@ resource "google_network_management_vpc_flow_logs_config" "example" { func testAccNetworkManagementVpcFlowLogsConfig_baseResources(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_compute_vpn_tunnel" "tunnel" { - provider = google-beta name = "tf-test-example-tunnel%{random_suffix}" peer_ip = "15.0.0.120" shared_secret = "a secret message" @@ -214,23 +198,19 @@ resource "google_compute_vpn_tunnel" "tunnel" { } resource "google_compute_vpn_gateway" "target_gateway" { - provider = google-beta name = "tf-test-example-gateway%{random_suffix}" network = google_compute_network.network.id } resource "google_compute_network" "network" { - provider = google-beta name = "tf-test-example-network%{random_suffix}" } resource "google_compute_address" "vpn_static_ip" { - provider = google-beta name = "tf-test-example-address%{random_suffix}" } resource "google_compute_forwarding_rule" "fr_esp" { - provider = google-beta name = "tf-test-example-fresp%{random_suffix}" ip_protocol = "ESP" ip_address = google_compute_address.vpn_static_ip.address @@ -238,7 +218,6 @@ resource "google_compute_forwarding_rule" "fr_esp" { } resource "google_compute_forwarding_rule" "fr_udp500" { - provider = google-beta name = "tf-test-example-fr500%{random_suffix}" ip_protocol = "UDP" port_range = "500" @@ -247,7 +226,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" { } resource "google_compute_forwarding_rule" "fr_udp4500" { - provider = google-beta name = "tf-test-example-fr4500%{random_suffix}" ip_protocol = "UDP" port_range = "4500" @@ -256,7 +234,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" { } resource "google_compute_route" "route" { - provider = google-beta name = "tf-test-example-route%{random_suffix}" network = google_compute_network.network.name dest_range = "15.0.0.0/24" @@ -266,4 +243,3 @@ resource "google_compute_route" "route" { `, context) } -{{ end }} From b9f1ef00823d8f2aa76e7ac086406f71c00acf2e Mon Sep 17 00:00:00 2001 From: alkobi-google Date: Mon, 16 Dec 2024 12:50:35 +0000 Subject: [PATCH 2/2] Change VPC Flow Logs update test from Beta to GA Signed-off-by: alkobi-google --- ...ource_network_management_vpc_flow_logs_config_test.go.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl b/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl index 90828e425929..04c17b73a924 100644 --- a/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl +++ b/mmv1/third_party/terraform/services/networkmanagement/resource_network_management_vpc_flow_logs_config_test.go.tmpl @@ -17,7 +17,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_updateInterconnect(t *testing.T) acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t), Steps: []resource.TestStep{ { @@ -124,7 +124,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_updateVpn(t *testing.T) { acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t), Steps: []resource.TestStep{ {