Skip to content

fix(operator): provide AWS region in environment variable for STS mode#21136

Open
xperimental wants to merge 2 commits intografana:mainfrom
xperimental:operator-workaround-sts
Open

fix(operator): provide AWS region in environment variable for STS mode#21136
xperimental wants to merge 2 commits intografana:mainfrom
xperimental:operator-workaround-sts

Conversation

@xperimental
Copy link
Collaborator

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-global region 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

  • Reviewed the CONTRIBUTING.md guide (required)
  • Tests updated
  • Title matches the required conventional commits format, see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant