Skip to content

Commit

Permalink
Fixed missing permissions error handling for aws_iam_user and aws_s3_…
Browse files Browse the repository at this point in the history
…bucket tables(#2324)
  • Loading branch information
danielgrittner authored Oct 28, 2024
1 parent cdb8ee7 commit dcb526e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions aws/table_aws_iam_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func getAwsIamUserData(ctx context.Context, d *plugin.QueryData, h *plugin.Hydra
UserName: user.UserName,
}

userData, _ := svc.GetUser(ctx, params)
userData, err := svc.GetUser(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_iam_user.getAwsIamUserData", "api_error", err)
return nil, err
Expand Down Expand Up @@ -367,7 +367,7 @@ func getAwsIamUserAttachedPolicies(ctx context.Context, d *plugin.QueryData, h *
UserName: user.UserName,
}

userData, _ := svc.ListAttachedUserPolicies(ctx, params)
userData, err := svc.ListAttachedUserPolicies(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_iam_user.getAwsIamUserAttachedPolicies", "api_error", err)
return nil, err
Expand Down Expand Up @@ -398,7 +398,7 @@ func getAwsIamUserGroups(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd
UserName: user.UserName,
}

userData, _ := svc.ListGroupsForUser(ctx, params)
userData, err := svc.ListGroupsForUser(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_iam_user.getAwsIamUserGroups", "api_error", err)
return nil, err
Expand All @@ -421,7 +421,7 @@ func getAwsIamUserMfaDevices(ctx context.Context, d *plugin.QueryData, h *plugin
UserName: user.UserName,
}

userData, _ := svc.ListMFADevices(ctx, params)
userData, err := svc.ListMFADevices(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_iam_user.getAwsIamUserMfaDevices", "api_error", err)
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions aws/table_aws_s3_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func getBucketTagging(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat

params := &s3.GetBucketTaggingInput{Bucket: bucketName}

bucketTags, _ := svc.GetBucketTagging(ctx, params)
bucketTags, err := svc.GetBucketTagging(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_s3_bucket.getBucketTagging", "api_error", err)
return nil, err
Expand All @@ -711,7 +711,7 @@ func getBucketWebsite(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat

params := &s3.GetBucketWebsiteInput{Bucket: bucketName}

bucketwebsites, _ := svc.GetBucketWebsite(ctx, params)
bucketwebsites, err := svc.GetBucketWebsite(ctx, params)
if err != nil {
plugin.Logger(ctx).Error("aws_s3_bucket.getBucketWebsite", "api_error", err)
return nil, err
Expand Down

0 comments on commit dcb526e

Please sign in to comment.