continue
continue copied to clipboard
AWS Bedrock with custom credential process
Before submitting your bug report
- [X] I believe this is a bug. I'll try to join the Continue Discord for questions
- [X] I'm not able to find an open issue that reports the same bug
- [ X] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: MacOS 14.6
- Continue: 0.0.64
- IDE: Pycharm 2024.2
- Model:Bedrock Sonnet
- config.json:
Description
Big fan of the project! Looks just like what I've been looking for.
When accessing a model via Bedrock using a credential process:
[default]
region=us-west-2
output=json
credential_process = cust_process get 555555555 Admin --json
Results in the following error:
[2024-09-05T04:46:13] CredentialsProviderError: Command failed: cust_process get 555555555 Admin --json /bin/sh: cust_process: command not found
when cust_process is in /usr/local/bin.
If I open PyCharm via the CLI open -a "PyCharm" everything works without problem. Also, the cust_process command works in terminal and various AWS plugins (Q Developer, AWS Toolkit). I tried to do some research how to source Intellij's
terminal environment from plugins but didn't have success.
To reproduce
- Create a Dummy Credential Process Script:
Create a simple script (e.g., dummy_credential_process.sh) that will act as the external process to provide AWS credentials. This script should output JSON in the format expected by AWS CLI. Make the following in /usr/local/bin/dummy_credential_process.sh
#!/bin/bash
cat <<EOF
{
"Version": 1,
"AccessKeyId": "DUMMY_ACCESS_KEY_ID",
"SecretAccessKey": "DUMMY_SECRET_ACCESS_KEY",
"SessionToken": "DUMMY_SESSION_TOKEN",
"Expiration": "$(date -u -d '+15 minutes' +'%Y-%m-%dT%H:%M:%SZ')"
}
EOF
Ensure the script is executable:
chmod +x dummy_credential_process.sh
- Configure AWS CLI to Use credential_process:
[profile dummy]
region = us-east-1
credential_process = /path/to/dummy_credential_process.sh
Replace /path/to/dummy_credential_process.sh with the actual path to your script.
- Refer to that in
.continue/config.json - Try to ask a question (it will fail)
- Open from the terminal that has a PATH set that can execute it and open PyCharm via
open -a "PyCharm". This time it should succeed if your AWS credentials are good.
Log output
[2024-09-05T04:46:13] Error running handler for "llm/streamChat": CredentialsProviderError: Command failed: cust_process get 555555555 Admin --json
/bin/sh: cust_process: command not found
[2024-09-05T04:46:13] CredentialsProviderError: Command failed: cust_process get 555555555 Admin --json
/bin/sh: cust_process: command not found