7
7
"context"
8
8
"errors"
9
9
"log"
10
- "reflect"
11
10
12
11
"github.com/aws/aws-sdk-go-v2/aws"
13
12
"github.com/aws/aws-sdk-go-v2/service/iam"
@@ -22,6 +21,7 @@ import (
22
21
"github.com/hashicorp/terraform-provider-aws/internal/flex"
23
22
tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices"
24
23
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
24
+ inttypes "github.com/hashicorp/terraform-provider-aws/internal/types"
25
25
"github.com/hashicorp/terraform-provider-aws/internal/verify"
26
26
"github.com/hashicorp/terraform-provider-aws/names"
27
27
)
@@ -275,10 +275,10 @@ func detachPolicyFromUsers(ctx context.Context, conn *iam.Client, users []string
275
275
}
276
276
277
277
func findEntitiesForPolicyByARN (ctx context.Context , conn * iam.Client , arn string ) ([]string , []string , []string , error ) {
278
- input := & iam.ListEntitiesForPolicyInput {
278
+ input := iam.ListEntitiesForPolicyInput {
279
279
PolicyArn : aws .String (arn ),
280
280
}
281
- groups , roles , users , err := findEntitiesForPolicy (ctx , conn , input )
281
+ groups , roles , users , err := findEntitiesForPolicy (ctx , conn , & input )
282
282
283
283
if err != nil {
284
284
return nil , nil , nil , err
@@ -316,17 +316,17 @@ func findEntitiesForPolicy(ctx context.Context, conn *iam.Client, input *iam.Lis
316
316
}
317
317
318
318
for _ , v := range page .PolicyGroups {
319
- if ! reflect . ValueOf ( v ). IsZero () {
319
+ if p := & v ; ! inttypes . IsZero (p ) {
320
320
groups = append (groups , v )
321
321
}
322
322
}
323
323
for _ , v := range page .PolicyRoles {
324
- if ! reflect . ValueOf ( v ). IsZero () {
324
+ if p := & v ; ! inttypes . IsZero (p ) {
325
325
roles = append (roles , v )
326
326
}
327
327
}
328
328
for _ , v := range page .PolicyUsers {
329
- if ! reflect . ValueOf ( v ). IsZero () {
329
+ if p := & v ; ! inttypes . IsZero (p ) {
330
330
users = append (users , v )
331
331
}
332
332
}
0 commit comments