From f1e7149c432f0ba392de7ae305c72da2053c2998 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 23 Jul 2019 09:12:30 -0700 Subject: [PATCH] Add additional import formats, extend identity logic (#947) Signed-off-by: Modular Magician --- google-beta/resource_cloud_scheduler_job.go | 1 + google-beta/resource_compute_address.go | 1 + google-beta/resource_compute_disk.go | 1 + .../resource_compute_forwarding_rule.go | 1 + .../resource_compute_ha_vpn_gateway.go | 1 + ...esource_compute_interconnect_attachment.go | 1 + .../resource_compute_network_endpoint.go | 20 +++++++++---------- ...resource_compute_network_endpoint_group.go | 1 + google-beta/resource_compute_node_group.go | 1 + google-beta/resource_compute_node_template.go | 1 + ...resource_compute_region_backend_service.go | 1 + google-beta/resource_compute_region_disk.go | 1 + .../resource_compute_resource_policy.go | 1 + .../resource_compute_target_instance.go | 1 + google-beta/resource_compute_vpn_gateway.go | 1 + google-beta/resource_compute_vpn_tunnel.go | 1 + google-beta/resource_filestore_instance.go | 1 + google-beta/resource_redis_instance.go | 1 + google-beta/resource_sql_database.go | 1 - google-beta/resource_tpu_node.go | 1 + .../docs/r/cloud_scheduler_job.html.markdown | 1 + website/docs/r/compute_address.html.markdown | 1 + website/docs/r/compute_disk.html.markdown | 1 + .../r/compute_forwarding_rule.html.markdown | 1 + .../r/compute_ha_vpn_gateway.html.markdown | 1 + ...pute_interconnect_attachment.html.markdown | 1 + .../r/compute_network_endpoint.html.markdown | 6 +++--- ...mpute_network_endpoint_group.html.markdown | 1 + .../docs/r/compute_node_group.html.markdown | 1 + .../r/compute_node_template.html.markdown | 1 + ...mpute_region_backend_service.html.markdown | 1 + .../docs/r/compute_region_disk.html.markdown | 1 + .../r/compute_resource_policy.html.markdown | 1 + .../r/compute_target_instance.html.markdown | 1 + .../docs/r/compute_vpn_gateway.html.markdown | 1 + .../docs/r/compute_vpn_tunnel.html.markdown | 1 + .../docs/r/filestore_instance.html.markdown | 1 + website/docs/r/redis_instance.html.markdown | 1 + website/docs/r/tpu_node.html.markdown | 1 + 39 files changed, 49 insertions(+), 14 deletions(-) diff --git a/google-beta/resource_cloud_scheduler_job.go b/google-beta/resource_cloud_scheduler_job.go index baf104cbbf..9d79f66bd4 100644 --- a/google-beta/resource_cloud_scheduler_job.go +++ b/google-beta/resource_cloud_scheduler_job.go @@ -389,6 +389,7 @@ func resourceCloudSchedulerJobImport(d *schema.ResourceData, meta interface{}) ( if err := parseImportId([]string{ "projects/(?P[^/]+)/locations/(?P[^/]+)/jobs/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_address.go b/google-beta/resource_compute_address.go index fe087d086c..78be368589 100644 --- a/google-beta/resource_compute_address.go +++ b/google-beta/resource_compute_address.go @@ -424,6 +424,7 @@ func resourceComputeAddressImport(d *schema.ResourceData, meta interface{}) ([]* if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/addresses/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_disk.go b/google-beta/resource_compute_disk.go index 712112b82e..c6a7cb2594 100644 --- a/google-beta/resource_compute_disk.go +++ b/google-beta/resource_compute_disk.go @@ -841,6 +841,7 @@ func resourceComputeDiskImport(d *schema.ResourceData, meta interface{}) ([]*sch if err := parseImportId([]string{ "projects/(?P[^/]+)/zones/(?P[^/]+)/disks/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_forwarding_rule.go b/google-beta/resource_compute_forwarding_rule.go index bdb60ad361..dc2ab0cfc3 100644 --- a/google-beta/resource_compute_forwarding_rule.go +++ b/google-beta/resource_compute_forwarding_rule.go @@ -600,6 +600,7 @@ func resourceComputeForwardingRuleImport(d *schema.ResourceData, meta interface{ if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/forwardingRules/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_ha_vpn_gateway.go b/google-beta/resource_compute_ha_vpn_gateway.go index 2b5b30bde0..4493cb7e1e 100644 --- a/google-beta/resource_compute_ha_vpn_gateway.go +++ b/google-beta/resource_compute_ha_vpn_gateway.go @@ -252,6 +252,7 @@ func resourceComputeHaVpnGatewayImport(d *schema.ResourceData, meta interface{}) if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/vpnGateways/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_interconnect_attachment.go b/google-beta/resource_compute_interconnect_attachment.go index 6d8e46cca2..8a1af8c516 100644 --- a/google-beta/resource_compute_interconnect_attachment.go +++ b/google-beta/resource_compute_interconnect_attachment.go @@ -376,6 +376,7 @@ func resourceComputeInterconnectAttachmentImport(d *schema.ResourceData, meta in if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/interconnectAttachments/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_network_endpoint.go b/google-beta/resource_compute_network_endpoint.go index b8446c6fd1..c6bf4928e0 100644 --- a/google-beta/resource_compute_network_endpoint.go +++ b/google-beta/resource_compute_network_endpoint.go @@ -277,10 +277,10 @@ func resourceComputeNetworkEndpointDelete(d *schema.ResourceData, meta interface func resourceComputeNetworkEndpointImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { config := meta.(*Config) if err := parseImportId([]string{ - "projects/(?P[^/]+)/zones/(?P[^/]+)/networkEndpointGroups/(?P[^/]+)/(?P[^/]+)", + "projects/(?P[^/]+)/zones/(?P[^/]+)/networkEndpointGroups/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", - "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", - "(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", }, d, config); err != nil { return nil, err } @@ -356,11 +356,11 @@ func flattenNestedComputeNetworkEndpoint(d *schema.ResourceData, meta interface{ if err != nil { return nil, err } - expectedPort, err := expandComputeNetworkEndpointPort(d.Get("port"), d, meta.(*Config)) + expectedIpAddress, err := expandComputeNetworkEndpointIpAddress(d.Get("ip_address"), d, meta.(*Config)) if err != nil { return nil, err } - expectedIpAddress, err := expandComputeNetworkEndpointIpAddress(d.Get("ip_address"), d, meta.(*Config)) + expectedPort, err := expandComputeNetworkEndpointPort(d.Get("port"), d, meta.(*Config)) if err != nil { return nil, err } @@ -384,16 +384,16 @@ func flattenNestedComputeNetworkEndpoint(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Skipping item with instance= %#v, looking for %#v)", itemInstance, expectedInstance) continue } - itemPort := flattenComputeNetworkEndpointPort(item["port"], d) - if !reflect.DeepEqual(itemPort, expectedPort) { - log.Printf("[DEBUG] Skipping item with port= %#v, looking for %#v)", itemPort, expectedPort) - continue - } itemIpAddress := flattenComputeNetworkEndpointIpAddress(item["ipAddress"], d) if !reflect.DeepEqual(itemIpAddress, expectedIpAddress) { log.Printf("[DEBUG] Skipping item with ipAddress= %#v, looking for %#v)", itemIpAddress, expectedIpAddress) continue } + itemPort := flattenComputeNetworkEndpointPort(item["port"], d) + if !reflect.DeepEqual(itemPort, expectedPort) { + log.Printf("[DEBUG] Skipping item with port= %#v, looking for %#v)", itemPort, expectedPort) + continue + } log.Printf("[DEBUG] Found item for resource %q: %#v)", d.Id(), item) return item, nil } diff --git a/google-beta/resource_compute_network_endpoint_group.go b/google-beta/resource_compute_network_endpoint_group.go index bc0aafaffa..3e9969e6ef 100644 --- a/google-beta/resource_compute_network_endpoint_group.go +++ b/google-beta/resource_compute_network_endpoint_group.go @@ -286,6 +286,7 @@ func resourceComputeNetworkEndpointGroupImport(d *schema.ResourceData, meta inte if err := parseImportId([]string{ "projects/(?P[^/]+)/zones/(?P[^/]+)/networkEndpointGroups/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_node_group.go b/google-beta/resource_compute_node_group.go index 92472d161b..0008f6dfac 100644 --- a/google-beta/resource_compute_node_group.go +++ b/google-beta/resource_compute_node_group.go @@ -303,6 +303,7 @@ func resourceComputeNodeGroupImport(d *schema.ResourceData, meta interface{}) ([ if err := parseImportId([]string{ "projects/(?P[^/]+)/zones/(?P[^/]+)/nodeGroups/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_node_template.go b/google-beta/resource_compute_node_template.go index ed5c3e02ab..7366d35a12 100644 --- a/google-beta/resource_compute_node_template.go +++ b/google-beta/resource_compute_node_template.go @@ -314,6 +314,7 @@ func resourceComputeNodeTemplateImport(d *schema.ResourceData, meta interface{}) if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/nodeTemplates/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_region_backend_service.go b/google-beta/resource_compute_region_backend_service.go index bfc4c6c159..a916a12445 100644 --- a/google-beta/resource_compute_region_backend_service.go +++ b/google-beta/resource_compute_region_backend_service.go @@ -515,6 +515,7 @@ func resourceComputeRegionBackendServiceImport(d *schema.ResourceData, meta inte if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/backendServices/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_region_disk.go b/google-beta/resource_compute_region_disk.go index bc43f452b5..9bed9472ce 100644 --- a/google-beta/resource_compute_region_disk.go +++ b/google-beta/resource_compute_region_disk.go @@ -595,6 +595,7 @@ func resourceComputeRegionDiskImport(d *schema.ResourceData, meta interface{}) ( if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/disks/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_resource_policy.go b/google-beta/resource_compute_resource_policy.go index c498a07f5d..8ba14f695f 100644 --- a/google-beta/resource_compute_resource_policy.go +++ b/google-beta/resource_compute_resource_policy.go @@ -363,6 +363,7 @@ func resourceComputeResourcePolicyImport(d *schema.ResourceData, meta interface{ if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/resourcePolicies/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_target_instance.go b/google-beta/resource_compute_target_instance.go index 21bed22261..7452c96c02 100644 --- a/google-beta/resource_compute_target_instance.go +++ b/google-beta/resource_compute_target_instance.go @@ -256,6 +256,7 @@ func resourceComputeTargetInstanceImport(d *schema.ResourceData, meta interface{ if err := parseImportId([]string{ "projects/(?P[^/]+)/zones/(?P[^/]+)/targetInstances/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_vpn_gateway.go b/google-beta/resource_compute_vpn_gateway.go index b9d31ef296..3161b1d504 100644 --- a/google-beta/resource_compute_vpn_gateway.go +++ b/google-beta/resource_compute_vpn_gateway.go @@ -238,6 +238,7 @@ func resourceComputeVpnGatewayImport(d *schema.ResourceData, meta interface{}) ( if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/targetVpnGateways/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_compute_vpn_tunnel.go b/google-beta/resource_compute_vpn_tunnel.go index cacf41a57a..02275e410e 100644 --- a/google-beta/resource_compute_vpn_tunnel.go +++ b/google-beta/resource_compute_vpn_tunnel.go @@ -657,6 +657,7 @@ func resourceComputeVpnTunnelImport(d *schema.ResourceData, meta interface{}) ([ if err := parseImportId([]string{ "projects/(?P[^/]+)/regions/(?P[^/]+)/vpnTunnels/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_filestore_instance.go b/google-beta/resource_filestore_instance.go index 9c63fd3a7d..7596d4605f 100644 --- a/google-beta/resource_filestore_instance.go +++ b/google-beta/resource_filestore_instance.go @@ -364,6 +364,7 @@ func resourceFilestoreInstanceImport(d *schema.ResourceData, meta interface{}) ( if err := parseImportId([]string{ "projects/(?P[^/]+)/locations/(?P[^/]+)/instances/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_redis_instance.go b/google-beta/resource_redis_instance.go index 824ca81812..f4fea7b0ee 100644 --- a/google-beta/resource_redis_instance.go +++ b/google-beta/resource_redis_instance.go @@ -450,6 +450,7 @@ func resourceRedisInstanceImport(d *schema.ResourceData, meta interface{}) ([]*s if err := parseImportId([]string{ "projects/(?P[^/]+)/locations/(?P[^/]+)/instances/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_sql_database.go b/google-beta/resource_sql_database.go index 0a1d9fff50..5098903c95 100644 --- a/google-beta/resource_sql_database.go +++ b/google-beta/resource_sql_database.go @@ -315,7 +315,6 @@ func resourceSqlDatabaseImport(d *schema.ResourceData, meta interface{}) ([]*sch "instances/(?P[^/]+)/databases/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)", - "(?P[^/]+):(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/google-beta/resource_tpu_node.go b/google-beta/resource_tpu_node.go index 65def08441..4f50ef6972 100644 --- a/google-beta/resource_tpu_node.go +++ b/google-beta/resource_tpu_node.go @@ -392,6 +392,7 @@ func resourceTpuNodeImport(d *schema.ResourceData, meta interface{}) ([]*schema. if err := parseImportId([]string{ "projects/(?P[^/]+)/locations/(?P[^/]+)/nodes/(?P[^/]+)", "(?P[^/]+)/(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", "(?P[^/]+)", }, d, config); err != nil { return nil, err diff --git a/website/docs/r/cloud_scheduler_job.html.markdown b/website/docs/r/cloud_scheduler_job.html.markdown index 5658952ec9..d88ce1f015 100644 --- a/website/docs/r/cloud_scheduler_job.html.markdown +++ b/website/docs/r/cloud_scheduler_job.html.markdown @@ -303,6 +303,7 @@ Job can be imported using any of these accepted formats: ``` $ terraform import google_cloud_scheduler_job.default projects/{{project}}/locations/{{region}}/jobs/{{name}} $ terraform import google_cloud_scheduler_job.default {{project}}/{{region}}/{{name}} +$ terraform import google_cloud_scheduler_job.default {{region}}/{{name}} $ terraform import google_cloud_scheduler_job.default {{name}} ``` diff --git a/website/docs/r/compute_address.html.markdown b/website/docs/r/compute_address.html.markdown index 86c0941ce6..a0904f15b2 100644 --- a/website/docs/r/compute_address.html.markdown +++ b/website/docs/r/compute_address.html.markdown @@ -217,6 +217,7 @@ Address can be imported using any of these accepted formats: ``` $ terraform import google_compute_address.default projects/{{project}}/regions/{{region}}/addresses/{{name}} $ terraform import google_compute_address.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_address.default {{region}}/{{name}} $ terraform import google_compute_address.default {{name}} ``` diff --git a/website/docs/r/compute_disk.html.markdown b/website/docs/r/compute_disk.html.markdown index f4ba4dcf01..7f75c26b19 100644 --- a/website/docs/r/compute_disk.html.markdown +++ b/website/docs/r/compute_disk.html.markdown @@ -284,6 +284,7 @@ Disk can be imported using any of these accepted formats: ``` $ terraform import google_compute_disk.default projects/{{project}}/zones/{{zone}}/disks/{{name}} $ terraform import google_compute_disk.default {{project}}/{{zone}}/{{name}} +$ terraform import google_compute_disk.default {{zone}}/{{name}} $ terraform import google_compute_disk.default {{name}} ``` diff --git a/website/docs/r/compute_forwarding_rule.html.markdown b/website/docs/r/compute_forwarding_rule.html.markdown index 7736eae681..db028b3596 100644 --- a/website/docs/r/compute_forwarding_rule.html.markdown +++ b/website/docs/r/compute_forwarding_rule.html.markdown @@ -303,6 +303,7 @@ ForwardingRule can be imported using any of these accepted formats: ``` $ terraform import google_compute_forwarding_rule.default projects/{{project}}/regions/{{region}}/forwardingRules/{{name}} $ terraform import google_compute_forwarding_rule.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_forwarding_rule.default {{region}}/{{name}} $ terraform import google_compute_forwarding_rule.default {{name}} ``` diff --git a/website/docs/r/compute_ha_vpn_gateway.html.markdown b/website/docs/r/compute_ha_vpn_gateway.html.markdown index 917430c4ca..dd229428c6 100644 --- a/website/docs/r/compute_ha_vpn_gateway.html.markdown +++ b/website/docs/r/compute_ha_vpn_gateway.html.markdown @@ -339,6 +339,7 @@ HaVpnGateway can be imported using any of these accepted formats: ``` $ terraform import -provider=google-beta google_compute_ha_vpn_gateway.default projects/{{project}}/regions/{{region}}/vpnGateways/{{name}} $ terraform import -provider=google-beta google_compute_ha_vpn_gateway.default {{project}}/{{region}}/{{name}} +$ terraform import -provider=google-beta google_compute_ha_vpn_gateway.default {{region}}/{{name}} $ terraform import -provider=google-beta google_compute_ha_vpn_gateway.default {{name}} ``` diff --git a/website/docs/r/compute_interconnect_attachment.html.markdown b/website/docs/r/compute_interconnect_attachment.html.markdown index 77c5933ddd..298cb42709 100644 --- a/website/docs/r/compute_interconnect_attachment.html.markdown +++ b/website/docs/r/compute_interconnect_attachment.html.markdown @@ -174,6 +174,7 @@ InterconnectAttachment can be imported using any of these accepted formats: ``` $ terraform import google_compute_interconnect_attachment.default projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}} $ terraform import google_compute_interconnect_attachment.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_interconnect_attachment.default {{region}}/{{name}} $ terraform import google_compute_interconnect_attachment.default {{name}} ``` diff --git a/website/docs/r/compute_network_endpoint.html.markdown b/website/docs/r/compute_network_endpoint.html.markdown index ccd287c4c5..4837eec0e0 100644 --- a/website/docs/r/compute_network_endpoint.html.markdown +++ b/website/docs/r/compute_network_endpoint.html.markdown @@ -140,10 +140,10 @@ This resource provides the following NetworkEndpoint can be imported using any of these accepted formats: ``` -$ terraform import google_compute_network_endpoint.default projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}/{{name}} +$ terraform import google_compute_network_endpoint.default projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} $ terraform import google_compute_network_endpoint.default {{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} -$ terraform import google_compute_network_endpoint.default {{project}}/{{zone}}/{{network_endpoint_group}}/{{name}} -$ terraform import google_compute_network_endpoint.default {{network_endpoint_group}}/{{name}} +$ terraform import google_compute_network_endpoint.default {{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} +$ terraform import google_compute_network_endpoint.default {{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}} ``` -> If you're importing a resource with beta features, make sure to include `-provider=google-beta` diff --git a/website/docs/r/compute_network_endpoint_group.html.markdown b/website/docs/r/compute_network_endpoint_group.html.markdown index 917b3dd128..6a19a4fe30 100644 --- a/website/docs/r/compute_network_endpoint_group.html.markdown +++ b/website/docs/r/compute_network_endpoint_group.html.markdown @@ -147,6 +147,7 @@ NetworkEndpointGroup can be imported using any of these accepted formats: ``` $ terraform import google_compute_network_endpoint_group.default projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{name}} $ terraform import google_compute_network_endpoint_group.default {{project}}/{{zone}}/{{name}} +$ terraform import google_compute_network_endpoint_group.default {{zone}}/{{name}} $ terraform import google_compute_network_endpoint_group.default {{name}} ``` diff --git a/website/docs/r/compute_node_group.html.markdown b/website/docs/r/compute_node_group.html.markdown index e4e681709a..b3cc7235f4 100644 --- a/website/docs/r/compute_node_group.html.markdown +++ b/website/docs/r/compute_node_group.html.markdown @@ -123,6 +123,7 @@ NodeGroup can be imported using any of these accepted formats: ``` $ terraform import google_compute_node_group.default projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}} $ terraform import google_compute_node_group.default {{project}}/{{zone}}/{{name}} +$ terraform import google_compute_node_group.default {{zone}}/{{name}} $ terraform import google_compute_node_group.default {{name}} ``` diff --git a/website/docs/r/compute_node_template.html.markdown b/website/docs/r/compute_node_template.html.markdown index 844bd70ca8..8d3a60a090 100644 --- a/website/docs/r/compute_node_template.html.markdown +++ b/website/docs/r/compute_node_template.html.markdown @@ -189,6 +189,7 @@ NodeTemplate can be imported using any of these accepted formats: ``` $ terraform import google_compute_node_template.default projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} $ terraform import google_compute_node_template.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_node_template.default {{region}}/{{name}} $ terraform import google_compute_node_template.default {{name}} ``` diff --git a/website/docs/r/compute_region_backend_service.html.markdown b/website/docs/r/compute_region_backend_service.html.markdown index 5aff494771..9e965f0501 100644 --- a/website/docs/r/compute_region_backend_service.html.markdown +++ b/website/docs/r/compute_region_backend_service.html.markdown @@ -217,6 +217,7 @@ RegionBackendService can be imported using any of these accepted formats: ``` $ terraform import google_compute_region_backend_service.default projects/{{project}}/regions/{{region}}/backendServices/{{name}} $ terraform import google_compute_region_backend_service.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_region_backend_service.default {{region}}/{{name}} $ terraform import google_compute_region_backend_service.default {{name}} ``` diff --git a/website/docs/r/compute_region_disk.html.markdown b/website/docs/r/compute_region_disk.html.markdown index 9c87a0d6fe..7b8f694930 100644 --- a/website/docs/r/compute_region_disk.html.markdown +++ b/website/docs/r/compute_region_disk.html.markdown @@ -252,6 +252,7 @@ RegionDisk can be imported using any of these accepted formats: ``` $ terraform import google_compute_region_disk.default projects/{{project}}/regions/{{region}}/disks/{{name}} $ terraform import google_compute_region_disk.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_region_disk.default {{region}}/{{name}} $ terraform import google_compute_region_disk.default {{name}} ``` diff --git a/website/docs/r/compute_resource_policy.html.markdown b/website/docs/r/compute_resource_policy.html.markdown index 1625ecedf6..5faf76a897 100644 --- a/website/docs/r/compute_resource_policy.html.markdown +++ b/website/docs/r/compute_resource_policy.html.markdown @@ -240,6 +240,7 @@ ResourcePolicy can be imported using any of these accepted formats: ``` $ terraform import -provider=google-beta google_compute_resource_policy.default projects/{{project}}/regions/{{region}}/resourcePolicies/{{name}} $ terraform import -provider=google-beta google_compute_resource_policy.default {{project}}/{{region}}/{{name}} +$ terraform import -provider=google-beta google_compute_resource_policy.default {{region}}/{{name}} $ terraform import -provider=google-beta google_compute_resource_policy.default {{name}} ``` diff --git a/website/docs/r/compute_target_instance.html.markdown b/website/docs/r/compute_target_instance.html.markdown index d6dd71d6aa..5ea06b7557 100644 --- a/website/docs/r/compute_target_instance.html.markdown +++ b/website/docs/r/compute_target_instance.html.markdown @@ -142,6 +142,7 @@ TargetInstance can be imported using any of these accepted formats: ``` $ terraform import google_compute_target_instance.default projects/{{project}}/zones/{{zone}}/targetInstances/{{name}} $ terraform import google_compute_target_instance.default {{project}}/{{zone}}/{{name}} +$ terraform import google_compute_target_instance.default {{zone}}/{{name}} $ terraform import google_compute_target_instance.default {{name}} ``` diff --git a/website/docs/r/compute_vpn_gateway.html.markdown b/website/docs/r/compute_vpn_gateway.html.markdown index 71b64545db..606913e697 100644 --- a/website/docs/r/compute_vpn_gateway.html.markdown +++ b/website/docs/r/compute_vpn_gateway.html.markdown @@ -158,6 +158,7 @@ VpnGateway can be imported using any of these accepted formats: ``` $ terraform import google_compute_vpn_gateway.default projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}} $ terraform import google_compute_vpn_gateway.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_vpn_gateway.default {{region}}/{{name}} $ terraform import google_compute_vpn_gateway.default {{name}} ``` diff --git a/website/docs/r/compute_vpn_tunnel.html.markdown b/website/docs/r/compute_vpn_tunnel.html.markdown index c7f291d1f1..c1fe6f8675 100644 --- a/website/docs/r/compute_vpn_tunnel.html.markdown +++ b/website/docs/r/compute_vpn_tunnel.html.markdown @@ -323,6 +323,7 @@ VpnTunnel can be imported using any of these accepted formats: ``` $ terraform import google_compute_vpn_tunnel.default projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}} $ terraform import google_compute_vpn_tunnel.default {{project}}/{{region}}/{{name}} +$ terraform import google_compute_vpn_tunnel.default {{region}}/{{name}} $ terraform import google_compute_vpn_tunnel.default {{name}} ``` diff --git a/website/docs/r/filestore_instance.html.markdown b/website/docs/r/filestore_instance.html.markdown index 7fb4ff8f4b..d5139487f4 100644 --- a/website/docs/r/filestore_instance.html.markdown +++ b/website/docs/r/filestore_instance.html.markdown @@ -160,6 +160,7 @@ Instance can be imported using any of these accepted formats: ``` $ terraform import google_filestore_instance.default projects/{{project}}/locations/{{zone}}/instances/{{name}} $ terraform import google_filestore_instance.default {{project}}/{{zone}}/{{name}} +$ terraform import google_filestore_instance.default {{zone}}/{{name}} $ terraform import google_filestore_instance.default {{name}} ``` diff --git a/website/docs/r/redis_instance.html.markdown b/website/docs/r/redis_instance.html.markdown index 0ec663b273..b4011da519 100644 --- a/website/docs/r/redis_instance.html.markdown +++ b/website/docs/r/redis_instance.html.markdown @@ -199,6 +199,7 @@ Instance can be imported using any of these accepted formats: ``` $ terraform import google_redis_instance.default projects/{{project}}/locations/{{region}}/instances/{{name}} $ terraform import google_redis_instance.default {{project}}/{{region}}/{{name}} +$ terraform import google_redis_instance.default {{region}}/{{name}} $ terraform import google_redis_instance.default {{name}} ``` diff --git a/website/docs/r/tpu_node.html.markdown b/website/docs/r/tpu_node.html.markdown index 7fc5fe74ee..bcc908df41 100644 --- a/website/docs/r/tpu_node.html.markdown +++ b/website/docs/r/tpu_node.html.markdown @@ -189,6 +189,7 @@ Node can be imported using any of these accepted formats: ``` $ terraform import google_tpu_node.default projects/{{project}}/locations/{{zone}}/nodes/{{name}} $ terraform import google_tpu_node.default {{project}}/{{zone}}/{{name}} +$ terraform import google_tpu_node.default {{zone}}/{{name}} $ terraform import google_tpu_node.default {{name}} ```