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 (#3455)

if the bucket is owned by a different account we can hit a 403 error
  • Loading branch information
vjeffrey authored Mar 4, 2024
1 parent 449d063 commit 1326076
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).Str("bucket", *bucket.Name).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).Str("bucket", *bucket.Name).Msg("Could not get bucket location (returned null)")
continue
}

region := string(location.LocationConstraint)
Expand Down

0 comments on commit 1326076

Please sign in to comment.