Skip to content

Commit

Permalink
Promote VPC Flow Logs Terraform API to GA (#12579) (#8917)
Browse files Browse the repository at this point in the history
[upstream:5e6616b9bfa37e9c5b1e2937215a7f2db3a2c0da]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Dec 16, 2024
1 parent 5e7e96b commit 1fa672d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .changelog/12579.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
networkmanagement: promoted `google_network_management_vpc_flow_logs_config` from Beta to GA
```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -58,11 +58,9 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi
func testAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfigInterconnectFullExample(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}"
Expand All @@ -74,12 +72,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 {
Expand All @@ -88,7 +84,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"
Expand All @@ -108,7 +103,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -127,23 +122,19 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi
func testAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfigInterconnectBasicExample(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-basic-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-basic-interconnect-test-network%{random_suffix}"
}
resource "google_compute_router" "router" {
provider = google-beta
name = "tf-test-basic-interconnect-test-router%{random_suffix}"
network = google_compute_network.network.name
bgp {
Expand All @@ -152,7 +143,6 @@ resource "google_compute_router" "router" {
}
resource "google_compute_interconnect_attachment" "attachment" {
provider = google-beta
name = "tf-test-basic-interconnect-test-id%{random_suffix}"
edge_availability_domain = "AVAILABILITY_DOMAIN_1"
type = "PARTNER"
Expand All @@ -172,7 +162,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -191,18 +181,15 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi
func testAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfigVpnBasicExample(context map[string]interface{}) string {
return acctest.Nprintf(`
data "google_project" "project" {
provider = google-beta
}
resource "google_network_management_vpc_flow_logs_config" "vpn-test" {
provider = google-beta
vpc_flow_logs_config_id = "tf-test-basic-test-id%{random_suffix}"
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 = "tf-test-basic-test-tunnel%{random_suffix}"
peer_ip = "15.0.0.120"
shared_secret = "a secret message"
Expand All @@ -216,31 +203,26 @@ resource "google_compute_vpn_tunnel" "tunnel" {
}
resource "google_compute_vpn_gateway" "target_gateway" {
provider = google-beta
name = "tf-test-basic-test-gateway%{random_suffix}"
network = google_compute_network.network.id
}
resource "google_compute_network" "network" {
provider = google-beta
name = "tf-test-basic-test-network%{random_suffix}"
}
resource "google_compute_address" "vpn_static_ip" {
provider = google-beta
name = "tf-test-basic-test-address%{random_suffix}"
}
resource "google_compute_forwarding_rule" "fr_esp" {
provider = google-beta
name = "tf-test-basic-test-fresp%{random_suffix}"
ip_protocol = "ESP"
ip_address = google_compute_address.vpn_static_ip.address
target = google_compute_vpn_gateway.target_gateway.id
}
resource "google_compute_forwarding_rule" "fr_udp500" {
provider = google-beta
name = "tf-test-basic-test-fr500%{random_suffix}"
ip_protocol = "UDP"
port_range = "500"
Expand All @@ -249,7 +231,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" {
}
resource "google_compute_forwarding_rule" "fr_udp4500" {
provider = google-beta
name = "tf-test-basic-test-fr4500%{random_suffix}"
ip_protocol = "UDP"
port_range = "4500"
Expand All @@ -258,7 +239,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" {
}
resource "google_compute_route" "route" {
provider = google-beta
name = "tf-test-basic-test-route%{random_suffix}"
network = google_compute_network.network.name
dest_range = "15.0.0.0/24"
Expand All @@ -277,7 +257,7 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckNetworkManagementVpcFlowLogsConfigDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -296,11 +276,9 @@ func TestAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfi
func testAccNetworkManagementVpcFlowLogsConfig_networkManagementVpcFlowLogsConfigVpnFullExample(context map[string]interface{}) string {
return acctest.Nprintf(`
data "google_project" "project" {
provider = google-beta
}
resource "google_network_management_vpc_flow_logs_config" "vpn-test" {
provider = google-beta
vpc_flow_logs_config_id = "tf-test-full-test-id%{random_suffix}"
location = "global"
vpn_tunnel = "projects/${data.google_project.project.number}/regions/us-central1/vpnTunnels/${google_compute_vpn_tunnel.tunnel.name}"
Expand All @@ -312,7 +290,6 @@ resource "google_network_management_vpc_flow_logs_config" "vpn-test" {
}
resource "google_compute_vpn_tunnel" "tunnel" {
provider = google-beta
name = "tf-test-full-test-tunnel%{random_suffix}"
peer_ip = "15.0.0.120"
shared_secret = "a secret message"
Expand All @@ -326,31 +303,26 @@ resource "google_compute_vpn_tunnel" "tunnel" {
}
resource "google_compute_vpn_gateway" "target_gateway" {
provider = google-beta
name = "tf-test-full-test-gateway%{random_suffix}"
network = google_compute_network.network.id
}
resource "google_compute_network" "network" {
provider = google-beta
name = "tf-test-full-test-network%{random_suffix}"
}
resource "google_compute_address" "vpn_static_ip" {
provider = google-beta
name = "tf-test-full-test-address%{random_suffix}"
}
resource "google_compute_forwarding_rule" "fr_esp" {
provider = google-beta
name = "tf-test-full-test-fresp%{random_suffix}"
ip_protocol = "ESP"
ip_address = google_compute_address.vpn_static_ip.address
target = google_compute_vpn_gateway.target_gateway.id
}
resource "google_compute_forwarding_rule" "fr_udp500" {
provider = google-beta
name = "tf-test-full-test-fr500%{random_suffix}"
ip_protocol = "UDP"
port_range = "500"
Expand All @@ -359,7 +331,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" {
}
resource "google_compute_forwarding_rule" "fr_udp4500" {
provider = google-beta
name = "tf-test-full-test-fr4500%{random_suffix}"
ip_protocol = "UDP"
port_range = "4500"
Expand All @@ -368,7 +339,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" {
}
resource "google_compute_route" "route" {
provider = google-beta
name = "tf-test-full-test-route%{random_suffix}"
network = google_compute_network.network.name
dest_range = "15.0.0.0/24"
Expand Down
Loading

0 comments on commit 1fa672d

Please sign in to comment.