Skip to content

Commit

Permalink
migrating router-bgp-peer to be a handwritten resource (#9559) (#16682)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
modular-magician authored Dec 5, 2023
1 parent 0ecdc7f commit 070e868
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 64 deletions.
3 changes: 3 additions & 0 deletions .changelog/9559.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none
Migrating resource from auto-generated to handwritten section
```
6 changes: 3 additions & 3 deletions google/provider/provider_mmv1_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
15 changes: 0 additions & 15 deletions google/services/compute/resource_compute_router_peer.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
15 changes: 0 additions & 15 deletions google/services/compute/resource_compute_router_peer_sweeper.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -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{}{
Expand All @@ -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",
Expand All @@ -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"
Expand Down
13 changes: 0 additions & 13 deletions website/docs/r/compute_router_peer.html.markdown
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 070e868

Please sign in to comment.