Skip to content

Commit

Permalink
Merge pull request #28800 from hashicorp/b-efs-file-system-policy
Browse files Browse the repository at this point in the history
efs/file_system_policy: Improve diff handling
  • Loading branch information
YakDriver committed Jan 10, 2023
2 parents 86bf014 + 4de5312 commit 08c1744
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/28800.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_efs_file_system_policy: Improve refresh to avoid unnecessary diffs in `policy`
```
13 changes: 9 additions & 4 deletions internal/service/efs/file_system_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ func ResourceFileSystemPolicy() *schema.Resource {
ForceNew: true,
},
"policy": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringIsJSON,
DiffSuppressFunc: verify.SuppressEquivalentPolicyDiffs,
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringIsJSON,
DiffSuppressFunc: verify.SuppressEquivalentPolicyDiffs,
DiffSuppressOnRefresh: true,
StateFunc: func(v interface{}) string {
json, _ := structure.NormalizeJsonString(v)
return json
},
},
},
}
Expand Down

0 comments on commit 08c1744

Please sign in to comment.