Skip to content

AWS Bedrock Config - Support for ENV credentials #1562

@bioshazard

Description

@bioshazard

AWS_BEDROCK_CONFIG currently expects hard coded access token, secret token, and session token. These should all be optional, and we should rely on the ai-sdk to handle whatever credentials we attempt. This would allow my use case which relies on ENV vars like EKS IRSA to let the pod assume the role without hard coded access and secret needed at workload initialization. Will work on this if I have time.

EDIT: I see btw that ai-sdk itself set those keys as optional. IMO you shouldn't even verify any of that, just hand it off to the upstream provider which will handle all the errors anyway and eliminate the chore of accounting for what it provides in the first place as it updates.

interface AmazonBedrockProviderSettings {
    region?: string;
    accessKeyId?: string;
    secretAccessKey?: string;
    sessionToken?: string;
    /**
     * Complete Bedrock configuration for setting advanced authentication and
     * other options. When this is provided, the region, accessKeyId, and
     * secretAccessKey settings are ignored.
     */
    bedrockOptions?: BedrockRuntimeClientConfig;
    generateId?: () => string;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions