aws / aws/aws-cli

The `configure list` command shows the wrong effective value and source for `region`.

Open
#9,856 1 comment 0 reactions 1 assignee Claimed by @RyanFitzSimmonsAK View on GitHub
automation-exempt bug credential-provider p2 response-requested
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### Describe the bug

When there is `region` key in the `~/.aws/credentials` file, as per AWS Documentation it has higher precedence then the one in `~/.aws/config`.

So when `AWS_REGION` env. var. is not set and we have `regions` keys in both files, the one in the credential file become the effective region when `--region` is not set in the CLI.

However printing out the `aws configure list` still shows the source as config file and the value is set to what is in the config file. While the value is indeed matching with the one in the config file, but this is NOT the effective value used.

This is very confusing and at this point we don't have a mean to show what is the actual effective value used.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Expected Behavior

It should shows that the source is from credential file and the value set in that file.

### Current Behavior

It shows that the source is from config file and the value set in that file.

### Reproduction Steps

1. Have `region` keys on the same profile in both config & shared credential files.
2. Unset `AWS_REGION` env. var.
3. Execute `aws configure list`.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CLI version used

aws-cli/2.32.1 Python/3.13.9 Linux/6.12.0-153.el10.x86_64 exe/x86_64.rhel.10

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

UBI (RedHat) 10 Container.

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.