From 070e86810b7b8727cc2962c76a65cf66513ab67a Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 5 Dec 2023 12:51:15 -0800 Subject: [PATCH] migrating router-bgp-peer to be a handwritten resource (#9559) (#16682) * Making router-bgp-peer as a handwritten resource * Adding sweeper file, removing example suffix from test files and adding resource in the handwritten section in provider * Removing unused import statements * Removing unused import statements from router_peer * Fix indentation --------- [upstream:99b5c55dd2b3f66b91a192e9a22a7ffe51a387b1] Signed-off-by: Modular Magician --- .changelog/9559.txt | 3 +++ google/provider/provider_mmv1_resources.go | 6 +++--- .../compute/resource_compute_router_peer.go | 15 ------------- .../resource_compute_router_peer_sweeper.go | 15 ------------- ...o => resource_compute_router_peer_test.go} | 21 +++---------------- .../docs/r/compute_router_peer.html.markdown | 13 ------------ 6 files changed, 9 insertions(+), 64 deletions(-) create mode 100644 .changelog/9559.txt rename google/services/compute/{resource_compute_router_peer_generated_test.go => resource_compute_router_peer_test.go} (88%) diff --git a/.changelog/9559.txt b/.changelog/9559.txt new file mode 100644 index 00000000000..49d4310a28b --- /dev/null +++ b/.changelog/9559.txt @@ -0,0 +1,3 @@ +```release-note:none +Migrating resource from auto-generated to handwritten section +``` diff --git a/google/provider/provider_mmv1_resources.go b/google/provider/provider_mmv1_resources.go index b950fd616c5..f6c4f3d7c1c 100644 --- a/google/provider/provider_mmv1_resources.go +++ b/google/provider/provider_mmv1_resources.go @@ -366,9 +366,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{ } // Resources -// Generated resources: 347 +// Generated resources: 346 // Generated IAM resources: 216 -// Total generated resources: 563 +// Total generated resources: 562 var generatedResources = map[string]*schema.Resource{ "google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(), "google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(), @@ -569,7 +569,6 @@ var generatedResources = map[string]*schema.Resource{ "google_compute_resource_policy": compute.ResourceComputeResourcePolicy(), "google_compute_route": compute.ResourceComputeRoute(), "google_compute_router": compute.ResourceComputeRouter(), - "google_compute_router_peer": compute.ResourceComputeRouterBgpPeer(), "google_compute_router_nat": compute.ResourceComputeRouterNat(), "google_compute_service_attachment": compute.ResourceComputeServiceAttachment(), "google_compute_snapshot": compute.ResourceComputeSnapshot(), @@ -935,6 +934,7 @@ var handwrittenResources = map[string]*schema.Resource{ "google_compute_attached_disk": compute.ResourceComputeAttachedDisk(), "google_compute_instance": compute.ResourceComputeInstance(), "google_compute_disk_async_replication": compute.ResourceComputeDiskAsyncReplication(), + "google_compute_router_peer": compute.ResourceComputeRouterBgpPeer(), "google_compute_instance_from_template": compute.ResourceComputeInstanceFromTemplate(), "google_compute_instance_group": compute.ResourceComputeInstanceGroup(), "google_compute_instance_group_manager": compute.ResourceComputeInstanceGroupManager(), diff --git a/google/services/compute/resource_compute_router_peer.go b/google/services/compute/resource_compute_router_peer.go index dc26bf2ca86..0e358d67343 100644 --- a/google/services/compute/resource_compute_router_peer.go +++ b/google/services/compute/resource_compute_router_peer.go @@ -1,20 +1,5 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - package compute import ( diff --git a/google/services/compute/resource_compute_router_peer_sweeper.go b/google/services/compute/resource_compute_router_peer_sweeper.go index 80a5aeb49a7..52791c57df0 100644 --- a/google/services/compute/resource_compute_router_peer_sweeper.go +++ b/google/services/compute/resource_compute_router_peer_sweeper.go @@ -1,20 +1,5 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - package compute import ( diff --git a/google/services/compute/resource_compute_router_peer_generated_test.go b/google/services/compute/resource_compute_router_peer_test.go similarity index 88% rename from google/services/compute/resource_compute_router_peer_generated_test.go rename to google/services/compute/resource_compute_router_peer_test.go index d75df8d9754..6f88291bb0c 100644 --- a/google/services/compute/resource_compute_router_peer_generated_test.go +++ b/google/services/compute/resource_compute_router_peer_test.go @@ -1,20 +1,5 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 - -// ---------------------------------------------------------------------------- -// -// *** AUTO GENERATED CODE *** Type: MMv1 *** -// -// ---------------------------------------------------------------------------- -// -// This file is automatically generated by Magic Modules and manual -// changes will be clobbered when the file is regenerated. -// -// Please read more about how to change this file in -// .github/CONTRIBUTING.md. -// -// ---------------------------------------------------------------------------- - package compute_test import ( @@ -30,7 +15,7 @@ import ( transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" ) -func TestAccComputeRouterBgpPeer_routerPeerRouterApplianceExample(t *testing.T) { +func TestAccComputeRouterBgpPeer_routerPeerRouterAppliance(t *testing.T) { t.Parallel() context := map[string]interface{}{ @@ -43,7 +28,7 @@ func TestAccComputeRouterBgpPeer_routerPeerRouterApplianceExample(t *testing.T) CheckDestroy: testAccCheckComputeRouterBgpPeerDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccComputeRouterBgpPeer_routerPeerRouterApplianceExample(context), + Config: testAccComputeRouterBgpPeer_routerPeerRouterAppliance(context), }, { ResourceName: "google_compute_router_peer.peer", @@ -55,7 +40,7 @@ func TestAccComputeRouterBgpPeer_routerPeerRouterApplianceExample(t *testing.T) }) } -func testAccComputeRouterBgpPeer_routerPeerRouterApplianceExample(context map[string]interface{}) string { +func testAccComputeRouterBgpPeer_routerPeerRouterAppliance(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_compute_network" "network" { name = "tf-test-my-router%{random_suffix}-net" diff --git a/website/docs/r/compute_router_peer.html.markdown b/website/docs/r/compute_router_peer.html.markdown index 2ca87f00a78..b5d755cb826 100644 --- a/website/docs/r/compute_router_peer.html.markdown +++ b/website/docs/r/compute_router_peer.html.markdown @@ -1,17 +1,4 @@ --- -# ---------------------------------------------------------------------------- -# -# *** AUTO GENERATED CODE *** Type: MMv1 *** -# -# ---------------------------------------------------------------------------- -# -# This file is automatically generated by Magic Modules and manual -# changes will be clobbered when the file is regenerated. -# -# Please read more about how to change this file in -# .github/CONTRIBUTING.md. -# -# ---------------------------------------------------------------------------- subcategory: "Compute Engine" description: |- BGP information that must be configured into the routing stack to