Skip to content

Commit

Permalink
Sort import regex's (#3283)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and chrisst committed Mar 20, 2019
1 parent 5bcb4d5 commit d1549bf
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion google/resource_compute_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func resourceComputeAutoscalerDelete(d *schema.ResourceData, meta interface{}) e

func resourceComputeAutoscalerImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/zones/(?P<zone>[^/]+)/autoscalers/(?P<name>[^/]+)", "(?P<zone>[^/]+)/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<zone>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/zones/(?P<zone>[^/]+)/autoscalers/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<zone>[^/]+)/(?P<name>[^/]+)", "(?P<zone>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_region_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func resourceComputeRegionAutoscalerDelete(d *schema.ResourceData, meta interfac

func resourceComputeRegionAutoscalerImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/autoscalers/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/autoscalers/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func resourceComputeRouterDelete(d *schema.ResourceData, meta interface{}) error

func resourceComputeRouterImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/routers/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/routers/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func resourceComputeSubnetworkDelete(d *schema.ResourceData, meta interface{}) e

func resourceComputeSubnetworkImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
config := meta.(*Config)
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/subnetworks/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
if err := parseImportId([]string{"projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/subnetworks/(?P<name>[^/]+)", "(?P<project>[^/]+)/(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<region>[^/]+)/(?P<name>[^/]+)", "(?P<name>[^/]+)"}, d, config); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_autoscaler.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ Autoscaler can be imported using any of these accepted formats:

```
$ terraform import google_compute_autoscaler.default projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}
$ terraform import google_compute_autoscaler.default {{zone}}/{{name}}
$ terraform import google_compute_autoscaler.default {{project}}/{{zone}}/{{name}}
$ terraform import google_compute_autoscaler.default {{zone}}/{{name}}
$ terraform import google_compute_autoscaler.default {{name}}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_region_autoscaler.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ RegionAutoscaler can be imported using any of these accepted formats:

```
$ terraform import google_compute_region_autoscaler.default projects/{{project}}/regions/{{region}}/autoscalers/{{name}}
$ terraform import google_compute_region_autoscaler.default {{region}}/{{name}}
$ terraform import google_compute_region_autoscaler.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_region_autoscaler.default {{region}}/{{name}}
$ terraform import google_compute_region_autoscaler.default {{name}}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_router.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ Router can be imported using any of these accepted formats:

```
$ terraform import google_compute_router.default projects/{{project}}/regions/{{region}}/routers/{{name}}
$ terraform import google_compute_router.default {{region}}/{{name}}
$ terraform import google_compute_router.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_router.default {{region}}/{{name}}
$ terraform import google_compute_router.default {{name}}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_subnetwork.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ Subnetwork can be imported using any of these accepted formats:

```
$ terraform import google_compute_subnetwork.default projects/{{project}}/regions/{{region}}/subnetworks/{{name}}
$ terraform import google_compute_subnetwork.default {{region}}/{{name}}
$ terraform import google_compute_subnetwork.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_subnetwork.default {{region}}/{{name}}
$ terraform import google_compute_subnetwork.default {{name}}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/container_node_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and [the API reference](https://cloud.google.com/container-engine/reference/rest
resource "google_container_cluster" "primary" {
name = "my-gke-cluster"
location = "us-central1"
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
Expand Down

0 comments on commit d1549bf

Please sign in to comment.