Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error handling for table_aws_iam_user and table_aws_s3_bucket #2324

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

danielgrittner
Copy link
Contributor

This PR fixes the error handling for some APIs for the table_aws_iam_user and table_aws_s3_bucket table. If an error occurs (e.g., missing permissions for the respective API), a nil pointer dereference error is thrown.

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
Add example SQL query results here (please include the input queries as well)

@misraved misraved added the hacktoberfest-accepted This pull request has been accepted for Hacktoberfest label Oct 23, 2024
@misraved misraved merged commit dcb526e into turbot:main Oct 28, 2024
1 check passed
@@ -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)
Copy link
Contributor

@pdecat pdecat Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to reveal an issue for S3 buckets without tags:

2024-11-07 17:15:06.715 UTC [ERROR] steampipe-plugin-aws.plugin: [ERROR] 1730999705950: table 'aws_s3_bucket' failed to get column data: table 'aws_s3_bucket' column 'tags_src' requires hydrate data from getBucketTagging, which failed with error operation error S3: GetBucketTagging, https response error StatusCode: 404, RequestID: ******, HostID: ******, api error NoSuchTagSet: The TagSet does not exist.

GetBucketTagging has the following special error:
Error code: NoSuchTagSet
Description: There is no tag set associated with the bucket.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html#RESTBucketGETtagging-responses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted This pull request has been accepted for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants