@@ -5,7 +5,6 @@ package iam
5
5
6
6
import (
7
7
"context"
8
- "reflect"
9
8
10
9
"github.com/aws/aws-sdk-go-v2/aws"
11
10
"github.com/aws/aws-sdk-go-v2/service/iam"
@@ -16,6 +15,7 @@ import (
16
15
"github.com/hashicorp/terraform-provider-aws/internal/conns"
17
16
"github.com/hashicorp/terraform-provider-aws/internal/errs"
18
17
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
18
+ inttypes "github.com/hashicorp/terraform-provider-aws/internal/types"
19
19
"github.com/hashicorp/terraform-provider-aws/names"
20
20
)
21
21
@@ -51,7 +51,6 @@ func dataSourceInstanceProfiles() *schema.Resource {
51
51
52
52
func dataSourceInstanceProfilesRead (ctx context.Context , d * schema.ResourceData , meta any ) diag.Diagnostics {
53
53
var diags diag.Diagnostics
54
-
55
54
conn := meta .(* conns.AWSClient ).IAMClient (ctx )
56
55
57
56
roleName := d .Get ("role_name" ).(string )
@@ -78,12 +77,12 @@ func dataSourceInstanceProfilesRead(ctx context.Context, d *schema.ResourceData,
78
77
}
79
78
80
79
func findInstanceProfilesForRole (ctx context.Context , conn * iam.Client , roleName string ) ([]awstypes.InstanceProfile , error ) {
81
- input := & iam.ListInstanceProfilesForRoleInput {
80
+ input := iam.ListInstanceProfilesForRoleInput {
82
81
RoleName : aws .String (roleName ),
83
82
}
84
83
var output []awstypes.InstanceProfile
85
84
86
- pages := iam .NewListInstanceProfilesForRolePaginator (conn , input )
85
+ pages := iam .NewListInstanceProfilesForRolePaginator (conn , & input )
87
86
for pages .HasMorePages () {
88
87
page , err := pages .NextPage (ctx )
89
88
@@ -99,7 +98,7 @@ func findInstanceProfilesForRole(ctx context.Context, conn *iam.Client, roleName
99
98
}
100
99
101
100
for _ , v := range page .InstanceProfiles {
102
- if ! reflect . ValueOf ( v ). IsZero () {
101
+ if p := & v ; ! inttypes . IsZero (p ) {
103
102
output = append (output , v )
104
103
}
105
104
}
0 commit comments