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

Default STS Client uses global endpoint but recommendation is now regional endpoints #3310

Open
1 of 2 tasks
bacoboy opened this issue Nov 23, 2024 · 4 comments
Open
1 of 2 tasks
Labels
documentation This is a problem with documentation. feature-request This issue requests a feature. p2 This is a standard priority issue sts

Comments

@bacoboy
Copy link

bacoboy commented Nov 23, 2024

Describe the feature

Around 2022, AWS announced that all new SDKs would change the default STS endpoint behavior from the legacy endpoint to regional as documented here.

All new SDK major versions releasing after July 2022 will default to regional.
New SDK major versions might remove this setting and use regional behavior.
To reduce future impact regarding this change, we recommend you start using
regional in your application when possible.

This is used when clients call sts:AssumeRole. Using the legacy behavior, clients connect to sts.amazonaws.com, which lives in us-east-1. Workloads outside of that region using this configuration unknowingly depend on that region since they are not using the regional endpoint where their code runs.

botocore was never updated, so today, all calls to the STS API, unless otherwise explicitly configured, will use the "global" endpoint in us-east-1.

There was an outage in Aug 2024 which impacted STS in us-east-1.

Had botocore been updated, this specific event would not have impaired workloads running in other regions using a default client.

This PR attempts to align the new "default" to regional as specified by the documentation.

Should you require the old behavior, you can always set the environment variable to override the new default back to legacy (as documented):

export AWS_STS_REGIONAL_ENDPOINTS=legacy

A follow-up change to the documentation here will be needed to reflect this change.

Use Case

Any workload running in a region should, by default, use the regional STS endpoint for role assumption.

Proposed Solution

I've started a pull request here with the proposed change to the defaults, so the default will select regional endpoints rather than the legacy configuration if no additional configuration is specified.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

Any current boto3 version

Environment details (OS name and version, etc.)

N/A - changes to SDK defaults

@bacoboy bacoboy added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Nov 23, 2024
@tim-finnigan tim-finnigan self-assigned this Nov 25, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Nov 25, 2024
@tim-finnigan
Copy link
Contributor

Thanks for the feature request — however it would be a breaking change for users who expect and rely on the current behavior. But the team is considering the implications of making this change in the future. In the meantime you can use the AWS_STS_REGIONAL_ENDPOINTS environment variable or sts_regional_endpoints configuration (documented here). The existing documentation could potentially be improved here to clarify the expected behavior and workarounds.

@tim-finnigan tim-finnigan added documentation This is a problem with documentation. p2 This is a standard priority issue sts and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Nov 25, 2024
@tim-finnigan tim-finnigan removed their assignment Nov 25, 2024
@bacoboy
Copy link
Author

bacoboy commented Nov 25, 2024

It is a change, but it isn't a breaking one. Can you elaborate on how this breaks anything? Thanks.

@tim-finnigan
Copy link
Contributor

It is a change, but it isn't a breaking one. Can you elaborate on how this breaks anything? Thanks.

This would be a breaking change for customers who expect the default configuration to be legacy. It could affect applications that rely on the global STS endpoint without explicitly configuring it. These apps might experience unexpected behavior or failures when suddenly using regional endpoints instead.

@bacoboy
Copy link
Author

bacoboy commented Dec 1, 2024

You just described every change made to this library.

As I understand it, only very old token usage falls into this category, and those folks are unlikely to upgrade the library, much less their token usage.

Can't simple downgrade instructions be provided for the edge cases that run into issues in the release notes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. feature-request This issue requests a feature. p2 This is a standard priority issue sts
Projects
None yet
Development

No branches or pull requests

2 participants