aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.49k stars 4.11k forks source link

CLI completely ignoring `--profile` flag #8602

Closed corneliusio closed 6 months ago

corneliusio commented 6 months ago

Describe the bug

I'm trying to get a separate AWS account setup for access on my local machine and the CLI doesn't even detect the --profile flag when passed.

Expected Behavior

Commands would be directed to the account using credentials in the defined profile.

Current Behavior

The command uses the [default] profile.

Reproduction Steps

$ aws s3 ls --profile cornelius --debug

2024-03-25 17:09:49,724 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.15.32 Python/3.11.8 Darwin/23.3.0 source/arm64
2024-03-25 17:09:49,724 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3', 'ls', '--debug']
# ...

Possible Solution

No response

Additional Information/Context

$ echo $AWS_PROFILE
$ cat ~/.aws/config

[default]
region = us-east-2
output = json

[profile cornelius]
region = us-east-2
output = json
$ cat ~/.aws/credentials

[default]
aws_access_key_id = 🔐
aws_secret_access_key = 🔐

[cornelius]
aws_access_key_id = 🔐
aws_secret_access_key = 🔐

CLI version used

aws-cli/2.15.32 Python/3.11.8 Darwin/23.3.0 source/arm64 prompt/off

Environment details (OS name and version, etc.)

Macbook Pro 16-inch, 2021; M1 Pro; macOS Sonoma 14.3.1 (23D60)

corneliusio commented 6 months ago

I think this is actually happening because 1Password is hijacking the command.

github-actions[bot] commented 6 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.