Skip to content

Commit

Permalink
Merge pull request #28796 from hashicorp/b-codebuild-repository-permi…
Browse files Browse the repository at this point in the history
…ssions-policy

codebuild/repository_permissions_policy: Improve policy diffs
  • Loading branch information
YakDriver authored Jan 10, 2023
2 parents e4e8e63 + 67376a9 commit da13362
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/28796.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_codebuild_resource_policy: Improve refresh to avoid unnecessary diffs in `policy`
```
13 changes: 9 additions & 4 deletions internal/service/codebuild/resource_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ func ResourceResourcePolicy() *schema.Resource {

Schema: map[string]*schema.Schema{
"policy": {
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: verify.SuppressEquivalentPolicyDiffs,
ValidateFunc: validation.StringIsJSON,
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: verify.SuppressEquivalentPolicyDiffs,
DiffSuppressOnRefresh: true,
ValidateFunc: validation.StringIsJSON,
StateFunc: func(v interface{}) string {
json, _ := structure.NormalizeJsonString(v)
return json
},
},
"resource_arn": {
Type: schema.TypeString,
Expand Down

0 comments on commit da13362

Please sign in to comment.