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

fix: Prevent global config of API Endpoint #97

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from

Conversation

neilramsay
Copy link

Issues

Description of changes:
There is a bug where the AWS SDK session is configured to use a specific endpoint.
This commit moves the endpoint configuration from the SDK Session to specific SDK Clients (SSM).

The SSM endpoint is passed in to the session-manager-plugin from the AWS CLI, and I believe the intention is to ensure any Region overrides from the AWS CLI are respected by the session-manager-plugin.

A problem occurs when the AWS credentials are sourced from AWS SSO / Identity Center.
When the SDK Session is configured with an endpoint, this overrides all Service Endpoints, including SDK internal SSO credential providers. When the current SSO credentials need to be refreshed, the refresh request is sent to https://ssm.[aws-region].amazonaws.com/token. The SSM API does not know about the /token endpoint, or CreateToken operation, and returns an UnknownOperation error.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

There is a bug where the AWS SDK session is
configured to use a specific endpoint.
This commit moves the endpoint configuration from the SDK Session to
specific SDK Clients (SSM).

The SSM endpoint is passed in to the session-manager-plugin from the
AWS CLI, and I believe the intention is to ensure any Region overrides
from the AWS CLI are respected by the session-manager-plugin.

A problem occurs when the AWS credentials are sourced from AWS SSO /
Identity Center.
When the SDK Session is configured with an endpoint, this overrides all
Service Endpoints, including SDK internal SSO credential providers.
When the current SSO credentials need to be refreshed, the refresh
request is sent to https://ssm.[aws-region].amazonaws.com/token.
The SSM API does not know about the /token endpoint, or CreateToken
operation, and returns an UnknownOperation error.
@neilramsay
Copy link
Author

Hi @Yangtao-Hua are you able to review this PR?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant