Add async resolver for AWS config values - #751
Merged
ubaskota merged 5 commits intoJul 28, 2026
Merged
Conversation
# Conflicts: # packages/smithy-aws-core/src/smithy_aws_core/config/exceptions.py
jonathan343
requested changes
Jul 24, 2026
jonathan343
reviewed
Jul 27, 2026
jonathan343
approved these changes
Jul 28, 2026
jonathan343
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks Ujjwal.
There are some UX things we'll want to clean up. But this is a good start and we have other work that depends on this, so I'm approving.
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.
Issue #, if available:
Description of changes:
This change implements the async config resolution pipeline with
AsyncAwsConfigusing aresolve()classmethod as the only construction path. It addsSharedConfigContextfor holding memoized config file data,FieldSpecfor per-field resolution metadata, and provenance tracking viaConfigSource. Resolvers forregionandretry_strategy_optionsare included along with validators for both fields.Testing:
Note: This is a revision to the old PR (#738) that was automatically closed after the feature branch was merged.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Key design points:
AsyncAwsConfigcannot be instantiated directly. CallingAsyncAwsConfig()raises aConfigError. All construction must go throughawait AsyncAwsConfig.resolve(), which ensures every field is resolved and validated before the object is returned.config.source_of("field_name").Usage
Direct instantiation is blocked:
Resolve from environment variables:
If
AWS_REGION=us-west-2is set in the environment:Resolve from config file:
If
~/.aws/configcontains:And no environment variables override these:
Override specific values:
Overrides passed to
resolve()take highest precedence — the value is validated but skips theenv/fileresolution chain entirely:Use a named profile:
If the profile doesn't exist:
Provenance tracking:
Override values after resolution:
Values can be changed after resolution using plugins. The source updates to OVERRIDE and the new value is validated: