feat(claude-code): first-class anthropic_base_url, use_bedrock, use_vertex inputs#864
Open
morganl-ant wants to merge 2 commits intocoder:mainfrom
Open
feat(claude-code): first-class anthropic_base_url, use_bedrock, use_vertex inputs#864morganl-ant wants to merge 2 commits intocoder:mainfrom
morganl-ant wants to merge 2 commits intocoder:mainfrom
Conversation
Member
|
Hi @morganl-ant I merged #861 so this needs rebase and a bit of refactor. Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running Claude Code against Bedrock, Vertex AI, or a self-hosted gateway through this module currently requires the template author to know the exact Claude Code env var names (
CLAUDE_CODE_USE_BEDROCK,CLAUDE_CODE_USE_VERTEX,ANTHROPIC_BASE_URL) and wire them up as separatecoder_envresources outside the module. The README Bedrock and Vertex examples are 30+ lines of copy-paste each, and they lead with static AWS access keys / GCP service-account JSON rather than the IAM-role / Workload Identity patterns most enterprise deployments actually use.When configured this way,
install.shstill prints "Note: Neither claude_api_key nor enable_aibridge is set, skipping authentication setup" on every workspace start, which reads to users as a misconfiguration even though their Bedrock/Vertex setup is correct (coder/coder#21835). There is also no way to point the module at a self-hosted Anthropic-protocol gateway short ofenable_aibridge, which is Coder-specific (coder/coder#17402).Changes
use_bedrockanduse_vertexbool inputs that setCLAUDE_CODE_USE_BEDROCK=1/CLAUDE_CODE_USE_VERTEX=1viacoder_env. Mutually exclusive with each other and withenable_aibridge.anthropic_base_urlstring input that setsANTHROPIC_BASE_URLfor self-hosted gateways. Mutually exclusive withenable_aibridge. The existingcoder_env.anthropic_base_urlresource is widened to fire on either condition; AI Bridge keeps precedence for the value.install.sh: when any of the three new inputs is set,configure_standalone_modeprints a clear "Using Amazon Bedrock / Google Vertex AI / custom ANTHROPIC_BASE_URL; Anthropic API key not required" message and returns early, instead of the misleading "Neither claude_api_key nor enable_aibridge is set" note.terraform testruns (env var assertions + 4 mutual-exclusionexpect_failures); 3 new bun tests covering the install.sh message paths andcoder_envoutputs.Validation
terraform fmt -recursivecleanterraform validatecleanterraform test26/26 passshellcheck --severity=warning scripts/install.shcleanCloses coder/coder#17402
Closes coder/coder#21835
Disclosure: I work at Anthropic on the Claude Code team.