Skip to content

Optional Bedrock auth for the 1-click stack (instance-profile, no Anthropic login) #104

Description

@defangdevs

Idea (Lio, 2026-07-17, evaluated during HN-launch prep): let the 1-click stack authenticate Claude Code via Amazon Bedrock using the EC2 instance profile — no Anthropic account or interactive claude login, billing consolidated into the AWS account that launched the stack.

What works (verified against docs 2026-07-17)

  • Claude Code supports it: CLAUDE_CODE_USE_BEDROCK=1 + AWS_REGION; models pinned via ANTHROPIC_DEFAULT_OPUS_MODEL / ANTHROPIC_DEFAULT_SONNET_MODEL / ANTHROPIC_DEFAULT_HAIKU_MODEL (pinning matters — the unpinned default primary is Opus, the expensive one).
  • Instance profile is enough (AWS SDK default credential chain): bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:ListInferenceProfiles, bedrock:GetInferenceProfile on inference-profile/* + foundation-model/*, plus the marketplace-subscribe statement gated on aws:CalledViaLast=bedrock.amazonaws.com. Easy to add behind a UseBedrock CFN condition.

Why it did NOT make the HN launch

  • Remote Control does not work on Bedrock (docs are explicit) — it ties to a claude.ai backend. That's a flagship agent-box feature; the template's RemoteControlSession output and the page copy would be wrong for Bedrock stacks.
  • Not actually 1-click: Anthropic model access requires a one-time per-account use-case form in the Bedrock console. The PutUseCaseForModelAccess API exists but automating it via a template Lambda is scope creep for launch.
  • Feature gaps on Bedrock: web search, fast mode, channels, routines, artifacts are unavailable; Fable models absent.
  • Pricing: for heavy interactive use, Max ($100/mo, 5x) usually beats Bedrock pass-through (Sonnet $3/$15 per Mtok + ~10% regional premium); Bedrock wins mainly for spiky/idle-most-of-the-time usage or org-mandated AWS billing.

Sketch when picked up

  • UseBedrock param (claude only) → IAM policy on the existing instance role, env block (CLAUDE_CODE_USE_BEDROCK, AWS_REGION, pinned model ids) in the module's user env, skip the login step in docs, suppress remoteControl + the RemoteControlSession output, document the one-time model-access console step as a pre-launch checkbox.
  • Region coupling: the box's region must have the Anthropic models; our four launch regions do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions