Skip to content

[v2] Configure subsections in the shared configuration file#10172

Merged
kdaily merged 20 commits intov2from
feature-configure-subsections
Apr 1, 2026
Merged

[v2] Configure subsections in the shared configuration file#10172
kdaily merged 20 commits intov2from
feature-configure-subsections

Conversation

@kdaily
Copy link
Copy Markdown
Member

@kdaily kdaily commented Mar 30, 2026

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 set to set properties in sub-sections, like an SSO Session or Services sub-section. It also adds functionality to use aws configure get to 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.

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
@kdaily kdaily linked an issue Mar 30, 2026 that may be closed by this pull request
2 tasks
@kdaily kdaily changed the title Feature configure subsections [v2] Configure subsections in the shared configuration file Mar 30, 2026
@kdaily kdaily marked this pull request as ready for review March 31, 2026 17:37
@kdaily kdaily merged commit de3481f into v2 Apr 1, 2026
145 of 148 checks passed
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.

Allow configuring sso-session settings non-interactively

2 participants