feat: support default AWS credentials chain instead of static creds#384
Open
Joseph Zhang (jzhn) wants to merge 2 commits into
Open
feat: support default AWS credentials chain instead of static creds#384Joseph Zhang (jzhn) wants to merge 2 commits into
Joseph Zhang (jzhn) wants to merge 2 commits into
Conversation
Contributor
|
Very nice. Taking a look! |
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.
What
Make the
bedrockprovider authenticate via the AWS SDK default credential provider chain (shared profile, IRSA/web-identity, ECS/EC2 instance role, or ambientAWS_*env vars) instead of requiring a pasted static access key + secret. Static keys remain supported for backwards compatibility.Why
Previously Bedrock only worked with long-lived
BEDROCK_AWS_ACCESS_KEY_ID/BEDROCK_AWS_SECRET_ACCESS_KEY, and onboarding blocked until they were entered. That's a non-starter for IRSA/ECS/instance-role deployments and anyone using a shared AWS profile.How
Bedrock is now a keyless provider, modeled on the existing
gemini-enterprise(Google ADC) pattern:PROVIDER_CONFIGS.bedrockno longer declaresapiKeyEnvKey/secretKeyEnvKey/regionEnvKey, so no provider-config machinery treats AWS creds as required.createModelpassescredentialsonly when bothBEDROCK_AWS_ACCESS_KEY_IDandBEDROCK_AWS_SECRET_ACCESS_KEYare set; otherwise it omits them and lets the SDK's default chain resolve. Region resolves fromBEDROCK_AWS_REGION→AWS_REGION→AWS_DEFAULT_REGION(the SDK only checksAWS_DEFAULT_REGIONon its own, so we bridgeAWS_REGIONwhich IRSA/ECS commonly inject).Usage
Default credential chain (no static keys needed):
OPENWIKI_PROVIDER=bedrock OPENWIKI_MODEL_ID=anthropic.claude-sonnet-5 # region from BEDROCK_AWS_REGION / AWS_REGION / AWS_DEFAULT_REGIONStatic-key override (unchanged behavior):
Tests
AWS_PROFILEwith credentials_process - credentials_process is invoked by openwiki to obtain Bedrock credentials