How do I use Claude via Bedrock with the Tasks Docker example?

Currently trying to set up https://github.com/coder/registry/tree/main/registry/coder-labs/templates/tasks-docker with Claude via AWS Bedrock. I've added the AWS keys, which Claude Code seems to detect. However, it reports that it's trying to use a US model. I've configured an EU model, which it reports via /status in Claude Code.
GitHub
registry/registry/coder-labs/templates/tasks-docker at main · code...
Publish Coder modules and templates for other developers to use. - coder/registry
Solution:
Removed the API key Claude env var entirely, then added the aws keys. If the env var for Claude API key exists, even it's empty, it won't correctly use Bedrock
Jump to solution
14 Replies
Codercord
Codercord2mo ago
Codercord
Codercord2mo ago
What are you creating this issue for?
Phorcys
Phorcys2mo ago
hey @potato5016, have you configured the AWS_REGION environment variable?
potato5016
potato5016OP2mo ago
Yep, inside resource "coder_agent" "main" in TF env { AWS_REGION = "eu-north-1" } inside the coder_agent => main resource
Phorcys
Phorcys2mo ago
yeah that should work can you check that it is actually being picked up by running env in the workspace's terminal?
potato5016
potato5016OP2mo ago
Yep, it's there. I think I might've figured it out - possibly needed to configure this? https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock#4-model-configuration Gonna try now
Phorcys
Phorcys2mo ago
oh yeah probably i'll edit the info in the template
potato5016
potato5016OP2mo ago
Still didn't work. /status has the right info, but I get this error on startup of Claude Code from Coder Then I can give one chat (e.g /status) before it starts failing completely with this error:
unexpected error occurred: failed to send message: failed to send message: failed to wait for screen to stabilize: timeout waiting for condition
unexpected error occurred: failed to send message: failed to send message: failed to wait for screen to stabilize: timeout waiting for condition
No description
potato5016
potato5016OP2mo ago
Seems like there must be some default model setting that I'm not correctly changing or something? I do get this error in /status:
Installation Health • /doctor
⚠ Config mismatch: running npm-global but config says unknown
Installation Health • /doctor
⚠ Config mismatch: running npm-global but config says unknown
Not quite sure what this error is trying to tell me
matifali
matifali2mo ago
@bpmct, @hugodutka can you take a look?
potato5016
potato5016OP2mo ago
I figured out the main problem: 1) Bedrock was misconfigured on my end Eventually got it to work by disabling prompt caching, then figured out the problem. However, the first message in Claude Code still is trying to use the US model, but all the other messages work fine. I can try a clean workspace and see if it goes away.
Phorcys
Phorcys2mo ago
what did you change in the configuration?
Solution
potato5016
potato50162mo ago
Removed the API key Claude env var entirely, then added the aws keys. If the env var for Claude API key exists, even it's empty, it won't correctly use Bedrock
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?