aws / aws/aws-cli

Support extension of configurations to other profiles

Open
#8,002 1 comment 18 reactions 0 assignees View on GitHub
configuration feature-request p2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the feature

Support base/general configuration (e.g. within the default profile), where other profiles may extend and override by referencing the base configuration.

### Use Case

Using multi-account architecture, AWS CLI configuration file include many profiles.
Rather the configuring each profile with the same configuration or have a small difference between each profile, if a profile could reference another profile then extend and override some configuration, it will ease and declutter the configuration file.

### Proposed Solution

Each profile can reference a list of other profiles, to apply/merge configuration from each referenced profile in the order they were specified. If a profile did not reference any other profiles, then apply the base/default configuration (which can come from the default profile).

```ini
[default]
# default configuration
output = json
region = us-east-1

[profile foo]
# use the default configuration if there is no reference to other profile
cli_timestamp_format = iso8601

[profile bar]
output = text
region = us-east-2

[profile baz]
extends = foo,bar
```

For instance, giving the configuration above, the following configuration will be equivalent

```ini
[default]
# default configuration
output = json
region = us-east-1

[profile foo]
output = json
region = us-east-1
cli_timestamp_format = iso8601

[profile bar]
output = text
region = us-east-2

[profile baz]
output = text
region = us-east-2
cli_timestamp_format = iso8601
```

### Other Information

- https://github.com/aws/aws-cli/discussions/7998

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CLI version used

2.12.1

### Environment details (OS name and version, etc.)

Ubuntu 22.04.2 LTS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.