[aws] Set region in config from GetBucketLocation API call#41572
[aws] Set region in config from GetBucketLocation API call#41572kaiyan-sheng merged 3 commits intoelastic:mainfrom
Conversation
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
|
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
| s3Client = s3.NewFromConfig(awsConfig, config.s3ConfigModifier) | ||
| if regionName != in.awsConfig.Region { | ||
| in.awsConfig.Region = regionName | ||
| s3Client = s3.NewFromConfig(in.awsConfig, in.config.s3ConfigModifier) |
There was a problem hiding this comment.
➕ for using pointers. From first look, old code should have worked without any issue. But seems, there's some buggy optimization from Go, making the call at 28 to have same aws config copy as used in line 20 😁
Good work catching this and fixing 🙌
tetianakravchenko
left a comment
There was a problem hiding this comment.
Thank you for a quick fix!
I've tested filebeat and it works!
This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50)
This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50)
This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50)
…tion API call (#41589) * [aws] Set region in config from GetBucketLocation API call (#41572) This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50) * Update CHANGELOG.next.asciidoc --------- Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
…tion API call (#41588) * [aws] Set region in config from GetBucketLocation API call (#41572) This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50) * Update CHANGELOG.next.asciidoc --------- Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
Proposed commit message
This PR sets the region of the S3 bucket as the region in AWS config to make API calls.
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Without this change, run Filebeat
aws-s3input with this config and you will see error:config:
The workaround is to add
default_region: us-east-2in the config.With this change, Filebeat is able to get the bucket location/region from API call and assign it to the region config.