fix(operator): provide AWS region in environment variable for STS mode#21136
Open
xperimental wants to merge 2 commits intografana:mainfrom
Open
fix(operator): provide AWS region in environment variable for STS mode#21136xperimental wants to merge 2 commits intografana:mainfrom
xperimental wants to merge 2 commits intografana:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
We noticed an issue when running Loki 3.6.5 configured using the operator in an environment using AWS STS. It was unable to initialize the S3 clients, because the STS endpoint could not be determined.
The root cause of this seems to be that the AWS SDK used by previous Loki versions did not support "regional STS endpoints" and always used the global STS endpoint, while the new AWS SDK requires either the
aws-globalregion or one of the other regions to be configured to be able to use STS and errors out in the case no region is defined.This change is a workaround which uses an environment variable (
AWS_REGION) to globally configure the AWS client to use a specific region. This causes the "default configuration" used by the client to already have a region configured which then propagates to the STS configuration.It's probably desirable to fix this directly in the S3 configuration code in Loki, so that it also populates the STS client with the correct region and not just the S3 client itself. This is not part of this PR at the moment.
Which issue(s) this PR fixes:
LOG-8901
Special notes for your reviewer:
This is only a fix in the context of the operator. From the perspective of Loki it's more a "workaround" than a proper fix.
Checklist
CONTRIBUTING.mdguide (required)