Skip to content

Commit

Permalink
Clarified usage docs for sorting by config order (GoogleCloudPlatform…
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath authored and pengq-google committed May 21, 2024
1 parent c77d7f6 commit 63c1c18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/develop/permadiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ In tests, add the field to `ImportStateVerifyIgnore` on any relevant import step
## API returns a list in a different order than was sent {#list-order}
For an Array of unique string values (or nested objects with unique string identifiers), use the `SortStringsByConfigOrder` or `SortMapsByConfigOrder` helper functions to sort the API response to match the order in the user's configuration. This will also simplify diffs if new values are added or removed.
For an Array of unique string values (or nested objects with unique string identifiers), use the `SortStringsByConfigOrder` or `SortMapsByConfigOrder` helper functions to sort the API response to match the order in the user's configuration. This will also simplify diffs if new values are added or removed. Imported resources will not have access to a configuration, so the field will be sorted alphabetically. This means that tests for the resource need to ignore the field's import behavior via `ignore_read_extra` (for MMv1 examples) or [`ImportStateVerifyIgnore`](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/import#importstateverifyignore-1) (for handwritten tests).
{{< tabs "diff_suppress_list" >}}
Expand Down Expand Up @@ -266,4 +266,4 @@ func flattenResourceNameFieldName(v interface{}, d *schema.ResourceData, config
{{< /tab >}}
{{< /tabs >}}

For other Array fields, convert the field to a Set – this is a [breaking change]({{< ref "/develop/breaking-changes/breaking-changes" >}}) and can only happen in a major release.
For other Array fields, convert the field to a Set – this is a [breaking change]({{< ref "/develop/breaking-changes/breaking-changes" >}}) and can only happen in a major release.

0 comments on commit 63c1c18

Please sign in to comment.