aws / aws/amazon-q-developer-cli

set default aws cli profile for q cli to use

Offen
#1,045 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Rust
Sterne
2k
Forks
439
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### 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"
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Die Payload nennt keine Quelldatei und keinen Test. Beginne damit, den q CLI-Pfad nachzuverfolgen, der den im Bericht gezeigten AWS CLI-Befehl erstellt, und prüfe, wie er das Profil auswählt; fertig ist die Änderung, wenn ein Benutzer ein Nicht-Standardprofil konfigurieren kann und dieser Befehl es verwendet, mit einer Abdeckung für den Fall eines fehlenden Standardprofils.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, rust
Bereich
cli, cloud
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.