Skip to content

Commit

Permalink
Merge pull request #28802 from hashicorp/b-events-policy-diffs
Browse files Browse the repository at this point in the history
events/bus_policy: Improve diffs
  • Loading branch information
YakDriver authored Jan 10, 2023
2 parents 08c1744 + 9676206 commit 071f3b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/28802.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_cloudwatch_event_bus_policy: Improve refresh to avoid unnecessary diffs in `policy`
```
9 changes: 5 additions & 4 deletions internal/service/events/bus_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ func ResourceBusPolicy() *schema.Resource {
Default: DefaultEventBusName,
},
"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 071f3b1

Please sign in to comment.