fix(credential-provider-node): pass client region to inner credential client region #5758
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.
Issue
related to #5749
related to #5755
Description
Currently, some credential providers have an "inner" or additional client not instantiated by the user. One example is the instantiation of an STS client for assumeRole, which is available to any SDK client without user input.
This inner client does not inherit configuration from the user instantiated, or "outer" client. That is because the credentialProvider functions (factories) are standalone and may be called outside of the context of an SDK client.
This PR passes in a reference to the outer client config (and its region) in one special case.
In this case, the outer client's region will be used as the fallback if the partition is not
aws
, such as govcloud. If the partition isaws
, then us-east-1 will be used as the fallback.See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html for partitions.
Testing
We will need to wait for the development of a suite of integration tests for credential providers.