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:Jump to 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
14 Replies
What are you creating this issue for?
hey @potato5016, have you configured the
AWS_REGION
environment variable?Yep, inside resource "coder_agent" "main" in TF
env { AWS_REGION = "eu-north-1" }
inside the coder_agent => main resourceyeah that should work
can you check that it is actually being picked up by running
env
in the workspace's terminal?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
oh yeah probably
i'll edit the info in the template
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:

Seems like there must be some default model setting that I'm not correctly changing or something?
I do get this error in /status:
Not quite sure what this error is trying to tell me
@bpmct, @hugodutka can you take a look?
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.
what did you change in the configuration?
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
@Phorcys closed the thread.