Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set default aws cli profile for q cli to use #1045

Open
3 tasks done
ensean opened this issue Apr 2, 2025 · 0 comments
Open
3 tasks done

set default aws cli profile for q cli to use #1045

ensean opened this issue Apr 2, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ensean
Copy link

ensean commented Apr 2, 2025

Checks

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

[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"
@mschrage mschrage added the bug Something isn't working label Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants