Retrieving wrong buckets in ListBucket action

0
Hi Reader,   I have integrated with AWS S3. It is working fine. But when I am using the ListBucket action of AWS S3, it retrieves all the buckets created in the AWS environment irrespective of region. Even AWS S3 ListBucket action requires Region as parameter but it is not retrieving as per its input region.   Requirement: I need the retrieve the buckets as per the provided region.   I am using static creds for authenticating AWS.
asked
2 answers
1

Hi Harshraj,

 

The latest version of the S3 module has access to the HeadBucket operation now. You can use this operation to get the Region back from a Bucket:

https://marketplace.mendix.com/link/component/120340

 

The documentation has been updated to reflect this change:

https://docs.mendix.com/appstore/modules/aws/amazon-s3/#headbucket

answered
0

Hi Harshraj,

 

It's not possible to get a List of only buckets from a single region. The only way to get a list from a single region is to call ListBuckets and to filter the output afterwards.

This is also not possible within AWS itself (without Mendix): https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html

 

The reason the Region is being used as an input in Mendix is because we use it for creating the "S3ClientBuilder" in the Java code.

answered