-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws] Set region in config from GetBucketLocation API call #41572
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
➕ 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 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
…41590) This PR sets the region of the S3 bucket as the region in AWS config to make API calls. (cherry picked from commit 076ea50) Co-authored-by: kaiyan-sheng <[email protected]>
…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 <[email protected]>
…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 <[email protected]>
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.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Without this change, run Filebeat
aws-s3
input with this config and you will see error:config:
The workaround is to add
default_region: us-east-2
in the config.With this change, Filebeat is able to get the bucket location/region from API call and assign it to the region config.