[v2] Configure subsections in the shared configuration file#10172
Merged
[v2] Configure subsections in the shared configuration file#10172
Conversation
This change adds new parameters to the `aws configure set`` command to specify a sub-section for setting a property. These parameters are analogous to the existing `--profile` parameter. A parameter will be added for each sub-section type and take a value of the subsection name. Following is the generic pattern for the `aws configure set` command: ``` aws configure set --<sub-section-type> <sub-section-name> \ <property> <value> ``` For example, the following command should set the property `sso_region` to the value `us-west-2` in the `sso-session` sub-section named `my-sso-session`: ``` aws configure set --sso-session my-sso-session \ sso_region us-west-2 ``` Following is an example setting a nested property in a sub-section: ``` aws configure set \ --<sub-section-type> <sub-section-name> \ <nested-section>.<property> value ``` The only sub-section types allowed are `services` and `sso-session`.
Remove the mapping between the subsection type and the parameter name. This is a transformation between '-' separated and '_' separated, so use a utility method to do this. Rename parameters to improve understanding of the code.
Only one level of nested properties is supported, e.g. 'aaa.bbb'. If the user supplies more than that (.aaa.bbb.ccc') an error is raised.
[v2] Add ability to set properties in subsections
Rename and add more test cases to cover non-exsistent subsections and nested properties.
A missing case, adding it for consistency with test for a non-existent sub-section.
These are better tested with functional tests.
[v2] Add ability to get values from properties in subsections
Run ruff check and format and add changelog
2 tasks
ashovlin
approved these changes
Apr 1, 2026
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:
Fixes #7835.
Description of changes:
Add the ability to configure sub-sections in the shared configuration file. This PR adds the functionality to use
aws configure setto set properties in sub-sections, like an SSO Session or Services sub-section. It also adds functionality to useaws configure getto retrieve values that have previously been set in sub-sections.Includes the following PRs to the feature branch:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.