Skip to content
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

[8.16](backport #41572) [aws] Set region in config from GetBucketLocation API call #41589

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 11, 2024

Proposed commit message

This PR sets the region of the S3 bucket as the region in AWS config to make API calls.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-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:

s3 GetObject failed: operation error S3: GetObject, https response error StatusCode: 301, RequestID: 01H7T2XWRZ6N44MW, HostID: WqYAZM+diCdCnBwj2i1tAzchSXBZql8SdIfQ0ZUCKHoR4YbMiBGD10duVYqIQ97pCg/j8MmJTgo=, api error PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

config:

filebeat.inputs:
- type: aws-s3
  enabled: true
  credential_profile_name: elastic-observability
  number_of_workers: 5
  bucket_arn: 'arn:aws:s3:::tkravchenko-test1'

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.


This is an automatic backport of pull request #41572 done by Mergify.

This PR sets the region of the S3 bucket as the region in AWS config to make API calls.

(cherry picked from commit 076ea50)
@mergify mergify bot added the backport label Nov 11, 2024
@mergify mergify bot requested a review from a team as a code owner November 11, 2024 16:56
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 11, 2024
@botelastic
Copy link

botelastic bot commented Nov 11, 2024

This pull request doesn't have a Team:<team> label.

@kaiyan-sheng kaiyan-sheng merged commit f0c8564 into 8.16 Nov 11, 2024
22 checks passed
@kaiyan-sheng kaiyan-sheng deleted the mergify/bp/8.16/pr-41572 branch November 11, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant