feat: add bedrock credential type for AWS Bedrock authentication#784
Open
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Open
feat: add bedrock credential type for AWS Bedrock authentication#784knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Conversation
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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add a new
bedrockcredential type that injects AWS environment variables (CLAUDE_CODE_USE_BEDROCK,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION) from a referenced Secret, with optional support forAWS_SESSION_TOKENandANTHROPIC_BEDROCK_BASE_URL.Refactor credential injection into a centralized
credentialEnvVars()function so that adding future providers (e.g. Vertex) requires only a new case block.Changes:
CredentialTypeBedrockconstant and update CRD enum validationcredentialEnvVars()to centralize credential env var injection for all typesbedrockconfig block in CLI for auto-creating AWS credential secretsexamples/09-bedrock-credentials/Which issue(s) this PR is related to:
Fixes #780
Special notes for your reviewer:
AWS_SESSION_TOKENandANTHROPIC_BEDROCK_BASE_URLare injected withOptional: trueon theSecretKeySelector, so pods won't fail if those keys are absent from the Secret.credentialEnvVars()refactor is a no-op for existingapi-keyandoauthtypes — it just moves the same logic into a single function.secretRefoptional, which is a separate API change. The IRSA workaround viapodOverrides.envis documented in the example README.Does this PR introduce a user-facing change?
Summary by cubic
Add a new
bedrockcredential type to run Claude Code via AWS Bedrock. Injects AWS env vars from a Secret, adds CLI/config to create/update it, and centralizes credential env var injection.New Features
bedrock; injectsCLAUDE_CODE_USE_BEDROCK=1,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION, plus optionalAWS_SESSION_TOKENandANTHROPIC_BEDROCK_BASE_URL.bedrockblock;kelos runcan create/updatekelos-credentials; completion includesbedrock; examples inexamples/09-bedrock-credentials/.secretRefremains required (workaround documented in the example).Refactors
credentialEnvVars()and use it forapi-key,oauth, andbedrock; add unit test for Bedrock injection.Written for commit d0a18b6. Summary will update on new commits.