diff --git a/mmv1/templates/tgc/resource_converters.go.erb b/mmv1/templates/tgc/resource_converters.go.erb index 6f2e4f37e154..aad7ac4d6c6f 100644 --- a/mmv1/templates/tgc/resource_converters.go.erb +++ b/mmv1/templates/tgc/resource_converters.go.erb @@ -43,6 +43,7 @@ func ResourceConverters() map[string][]cai.ResourceConverter { "google_compute_global_forwarding_rule": {compute.ResourceConverterComputeGlobalForwardingRule()}, "google_compute_instance": {compute.ResourceConverterComputeInstance()}, "google_compute_network": {compute.ResourceConverterComputeNetwork()}, + "google_compute_route": {compute.ResourceConverterComputeRoute()}, "google_compute_security_policy": {resourceConverterComputeSecurityPolicy()}, "google_compute_snapshot": {compute.ResourceConverterComputeSnapshot()}, "google_compute_subnetwork": {compute.ResourceConverterComputeSubnetwork()}, diff --git a/mmv1/third_party/tgc/tests/data/example_compute_route.json b/mmv1/third_party/tgc/tests/data/example_compute_route.json new file mode 100644 index 000000000000..27d4c23684ce --- /dev/null +++ b/mmv1/third_party/tgc/tests/data/example_compute_route.json @@ -0,0 +1,23 @@ +[ + { + "name": "//compute.googleapis.com/projects/{{.Provider.project}}/global/routes/my-route", + "ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}", + "asset_type": "compute.googleapis.com/Route", + "resource": { + "version": "beta", + "discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/beta/rest", + "discovery_name": "Route", + "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}", + "data": { + "destRange": "10.1.0.0/16", + "name": "my-route", + "network": "projects/{{.Provider.project}}/global/networks/my-network", + "nextHopIp": "10.0.0.1", + "priority": 1000 + } + }, + "ancestors": [ + "organizations/{{.OrgID}}" + ] + } +] \ No newline at end of file diff --git a/mmv1/third_party/tgc/tests/data/example_compute_route.tf b/mmv1/third_party/tgc/tests/data/example_compute_route.tf new file mode 100644 index 000000000000..7ff8314dfc4a --- /dev/null +++ b/mmv1/third_party/tgc/tests/data/example_compute_route.tf @@ -0,0 +1,19 @@ +terraform { + required_providers { + google = { + source = "hashicorp/google-beta" + version = "~> {{.Provider.version}}" + } + } +} + +provider "google" { + {{if .Provider.credentials }}credentials = "{{.Provider.credentials}}"{{end}} +} + +resource "google_compute_route" "my_route" { + name = "my-route" + dest_range = "10.1.0.0/16" + next_hop_ip = "10.0.0.1" + network = "my-network" +} \ No newline at end of file