Skip to content

chat_bedrock() does not handle AWS credentials that expire #261

@atheriel

Description

@atheriel

Right now we look up AWS credentials only once, in chat_bedrock():

credentials <- paws_credentials(profile)

and then use these static credentials to sign requests:

req <- req_auth_aws_v4(
req,
aws_access_key_id = provider@credentials$access_key_id,
aws_secret_access_key = provider@credentials$secret_access_key,
aws_session_token = provider@credentials$session_token
)

This causes problems when using temporary IAM credentials, as is commonly the case when using IAM on Kubernetes or with Workbench-managed credentials (both of which use AssumeRoleWithWebIdentity under the hood).

With the default settings these credentials will expire after an hour, at which point all future requests will fail. You can sidestep this by recreating the chat and passing in the existing Turns, but it seems like we should be handling credential expiry here directly instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions