Skip to content

Commit

Permalink
Merge pull request #28791 from hashicorp/b-backup-vault-policy
Browse files Browse the repository at this point in the history
backup/vault_policy: Improve diff handling for policies
  • Loading branch information
YakDriver authored Jan 10, 2023
2 parents 96e6519 + c6f1988 commit 7a7997f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/28791.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_backup_vault_policy: Improve refresh to avoid unnecessary diffs in `policy`
```
9 changes: 5 additions & 4 deletions internal/service/backup/vault_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ func ResourceVaultPolicy() *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 7a7997f

Please sign in to comment.