Skip to content

AWS S3 Resources tagged with wrong region #1507

@urkle

Description

@urkle

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:

  1. Configure an AWS account
  2. have two S3 bucket in different regions. e.g us-east-1 and us-east-2
  3. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions