[FEATURE]: Support an Opencode-specific AWS profile #2816

Closed
opened 2026-02-16 17:37:21 -05:00 by yindo · 8 comments
Owner

Originally created by @wilcosec on GitHub (Nov 12, 2025).

Originally assigned to: @rekram1-node on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I would like to use Opencode with Amazon Bedrock in an AWS account different than the one I'm deploying to. Setting AWS_PROFILE system wide forces the two to be the same.

Rational: I have one AWS account specifically designated for Bedrock use (and Sagemaker and other AI tools). It is not the account we use as our test bed.

I see other tools solve with with a custom set of environment variables. For example:

export AWS_PROFILE="sandbox"
export AWS_REGION="us-west-2"
export OPENCODE_AWS_PROFILE="bedrock"
export OPENCODE_AWS_REGION="us-east-1"

By prioritizing OPENCODE_ environment variables, users could easily work with services in one AWS account while Opencode uses Amazon Bedrock in another.

Originally created by @wilcosec on GitHub (Nov 12, 2025). Originally assigned to: @rekram1-node on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request I would like to use Opencode with Amazon Bedrock in an AWS account different than the one I'm deploying to. Setting `AWS_PROFILE` system wide forces the two to be the same. Rational: I have one AWS account specifically designated for Bedrock use (and Sagemaker and other AI tools). It is not the account we use as our test bed. I see other tools solve with with a custom set of environment variables. For example: ```bash export AWS_PROFILE="sandbox" export AWS_REGION="us-west-2" export OPENCODE_AWS_PROFILE="bedrock" export OPENCODE_AWS_REGION="us-east-1" ``` By prioritizing `OPENCODE_` environment variables, users could easily work with services in one AWS account while Opencode uses Amazon Bedrock in another.
yindo added the help-wanteddiscussion labels 2026-02-16 17:37:21 -05:00
yindo closed this issue 2026-02-16 17:37:21 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 12, 2025):

Yeah someone else asked for this w/ vertex

I think this shouldnt be too difficult but wed wanna do it across the board prolly

@rekram1-node commented on GitHub (Nov 12, 2025): Yeah someone else asked for this w/ vertex I think this shouldnt be too difficult but wed wanna do it across the board prolly
Author
Owner

@thoroc commented on GitHub (Nov 12, 2025):

Can you use a tool like dotenvx as a work around? I use Bedrock and load the AWS_PROFILE and AWS_REGION from the .env that way: dotenvx run -- opencode

@thoroc commented on GitHub (Nov 12, 2025): Can you use a tool like dotenvx as a work around? I use Bedrock and load the AWS_PROFILE and AWS_REGION from the .env that way: `dotenvx run -- opencode`
Author
Owner

@wilcosec commented on GitHub (Nov 12, 2025):

It's a simple workaround with AWS_PROFILE=bedrock opencode. Just thought it would be nice for me (and probably others) if Opencode had a superset of environment variables as I described above. I got the idea from the Zed IDE, and it's nice to just set it and forget it.

@wilcosec commented on GitHub (Nov 12, 2025): It's a simple workaround with `AWS_PROFILE=bedrock opencode`. Just thought it would be nice for me (and probably others) if Opencode had a superset of environment variables as I described above. I got the idea from the Zed IDE, and it's nice to just set it and forget it.
Author
Owner

@rekram1-node commented on GitHub (Nov 13, 2025):

yeah I think it's fair

@rekram1-node commented on GitHub (Nov 13, 2025): yeah I think it's fair
Author
Owner

@sandipwane commented on GitHub (Nov 14, 2025):

Agree with the author. In our setup also we have different account setup for bedrock while the default setup points to regular account.

@sandipwane commented on GitHub (Nov 14, 2025): Agree with the author. In our setup also we have different account setup for bedrock while the default setup points to regular account.
Author
Owner

@rekram1-node commented on GitHub (Nov 14, 2025):

Yeah this should be easy to add, I can work on it if I get a chance soon

@rekram1-node commented on GitHub (Nov 14, 2025): Yeah this should be easy to add, I can work on it if I get a chance soon
Author
Owner

@Shackelford-Arden commented on GitHub (Dec 16, 2025):

If this merits a different issue, let me know and I'll open one.

Something that I'd find helpful in this scenario is being able to specify what profile to use for this provider in the config file (global or project level).

@Shackelford-Arden commented on GitHub (Dec 16, 2025): If this merits a different issue, let me know and I'll open one. Something that I'd find helpful in this scenario is being able to specify what profile to use for this provider in the config file (global or project level).
Author
Owner

@wilcosec commented on GitHub (Feb 3, 2026):

This can be accomplished with a configuration profile for bedrock. I like this approach. Closing this issue.

@wilcosec commented on GitHub (Feb 3, 2026): This can be accomplished with a [configuration profile for bedrock](https://opencode.ai/docs/providers/#configuration-file-recommended). I like this approach. Closing this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2816