aws / aws/amazon-q-developer-cli

set default aws cli profile for q cli to use

Aperta
#1,045 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 15.3.2 (24D81)

### Expected behaviour

q cli 's default cli credential profile should can be configured.

### Actual behaviour

multiple aws cli credential profile may be configured on a devops machine to achieve the least privilege policy. If no `default` profile is configured, q cli will fail to find the correct credential with the following error:

```
> list my ec2 in tokyo

I'll help you list your EC2 instances in the Tokyo region (ap-northeast-1). Let me run the AWS CLI command for you:

Use AWS CLI
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Running aws cli command:
Service name: ec2
Operation name: describe-instances
Parameters:
Profile name: default
Region: ap-northeast-1
Label: List EC2 instances in Tokyo region

Using AWS CLI...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

🔴 Execution failed after 2.755s:

Unable to locate credentials. You can configure credentials by running "aws configure".

It looks like AWS credentials aren't configured in your environment. To list your EC2 instances in Tokyo, you'll need to set up your AWS credentials
first. You can do this by running:

bash
aws configure

This will prompt you to enter:
1. Your AWS Access Key ID
2. Your AWS Secret Access Key
3. Default region name (enter 'ap-northeast-1' for Tokyo)
4. Default output format (json is recommended)

Once you've configured your credentials, you can try listing your EC2 instances again by running:

bash
aws ec2 describe-instances --region ap-northeast-1
```

### Steps to reproduce

_No response_

### Environment

```yaml
[q-details]
version = "1.7.2"
hash = "b6bf5f1675dd7395009e8bc65c1145820671f211"
date = "2025-03-21T01:36:16.66764Z (12d ago)"
variant = "full"

[system-info]
os = "macOS 15.3.2 (24D81)"
chip = "Apple M3 Pro"
total-cores = 11
memory = "18.00 GB"

[environment]
cwd = "/Users/USER"
cli-path = "/Users/USER"
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "iTerm 2"
install-method = "unknown"

[env-vars]
PATH = "/Users/USER/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/USER/.local/bin:/Users/USER/.lmstudio/bin"
QTERM_SESSION_ID = "d8cc21627c3f40bf8e8eac7cf6e50e72"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.7.2"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.googlecode.iterm2"
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Il payload non indica alcun file sorgente né alcun test. Inizia tracciando il percorso di q CLI che costruisce il comando AWS CLI mostrato nel report e verifica come seleziona il profilo; il lavoro è completato quando un utente può configurare un profilo non predefinito e quel comando lo utilizza, con una copertura per il caso in cui manchi il profilo predefinito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, rust
Ambito
cli, cloud
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.