Skip to content

Commit

Permalink
🧹 do not fail s3 buckets resource when no location found, warn and co…
Browse files Browse the repository at this point in the history
…ntinue

if the bucket is owned by a different account we can hit a 403 error
  • Loading branch information
vjeffrey committed Feb 29, 2024
1 parent 7dc1124 commit 84bb6e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions providers/aws/resources/aws_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ func (a *mqlAwsS3) buckets() ([]interface{}, error) {
Bucket: bucket.Name,
})
if err != nil {
return nil, errors.Wrap(err, "Could not get bucket location")
log.Error().Err(err).Msg("Could not get bucket location")
continue
}
if location == nil {
return nil, errors.New("Could not get bucket location (returned null)")
log.Error().Err(err).Msg("Could not get bucket location (returned null)")
continue
}

region := string(location.LocationConstraint)
Expand Down

0 comments on commit 84bb6e3

Please sign in to comment.