-
Notifications
You must be signed in to change notification settings - Fork 454
Description
Describe the bug
AWS S3 Resources are labeled with the wrong region when there are S3 buckets in multiple regions. All buckets end up being in the last region scanned.
To Reproduce
Steps to reproduce the behavior:
- Configure an AWS account
- have two S3 bucket in different regions. e.g us-east-1 and us-east-2
- start komiser
Expected behavior
The buckets are tagged with the correct region (e.g. different regions)
Instead both are tagged with us-east-2
using the AWS CLI I can use the get-bucket-location API to get the correct region.
( https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html )
aws s3api get-bucket-location --bucket my_bucket_name
{
"LocationConstraint": "us-east-2"
}
OR head-bucket (AWS's preferred API to detect this)
( https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html )
aws s3api head-bucket --bucket my_bucket_name
{
"BucketRegion": "us-east-2",
"AccessPointAlias": false
}
I believe the source of this issue is that the list-buckets API lists ALL buckets for the account regardless of the region.
Komiser version
Version: 3.1.20
Go Version: go1.23.0
Commit: 2ecdf84
OS/Arch: darwin/amd64
Built: 1724082162
Desktop (please complete the following information):
- OS: MacOS X 12.7.6
- Browser: Firefox
- Version: 130.0