Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda container with Bedrock #1673

Open
cfsnate opened this issue Apr 4, 2025 · 4 comments
Open

Lambda container with Bedrock #1673

cfsnate opened this issue Apr 4, 2025 · 4 comments
Labels

Comments

@cfsnate
Copy link

cfsnate commented Apr 4, 2025

Git provider (optional)

github.com

System Info (optional)

Lambda standard setup

Issues details

I've gotten the lambda container working with Anthropic API key. However, has anyone gotten this working with Bedrock? It doesn't seem like the container is able to use the execution role in the IAM chain

@cfsnate cfsnate added the general label Apr 4, 2025
Copy link
Contributor

💡 Auto-generated documentation-based answer:

Yes, you can use Amazon Bedrock with PR-Agent in a Lambda container. To configure this, you need to:

  1. Set the model in your configuration file:
[config]
model="bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0"
fallback_models=["bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0"]
  1. For authentication, PR-Agent will use the Lambda execution role automatically if you don't explicitly set AWS credentials. The Lambda execution role needs to have the appropriate permissions to access Bedrock.

If you're experiencing issues with the execution role, make sure:

  • Your Lambda execution role has the necessary Bedrock permissions
  • You're not explicitly setting AWS credentials in your configuration that might override the execution role

For more details on Bedrock configuration, check the documentation on changing models.

Relevant Sources:

@cfsnate
Copy link
Author

cfsnate commented Apr 4, 2025

Per auto-docs, that was my expectation but doesn't appear to work. Has anyone successfully done this?

@mrT23
Copy link
Collaborator

mrT23 commented Apr 4, 2025

done what ?

As the docs say, the auth that is currently supported is using an AWS_ACCESS_KEY_ID andAWS_SECRET_ACCESS_KEY parmas.

Image

it works.

I don't know exactly what is "execution role in the IAM chain".
You are welcome to investigate how to use that in litellm (maybe its this, I am not sure https://docs.litellm.ai/docs/providers/bedrock#sts-role-based-auth) and open a PR to add support for this additional flow in PR Agent

@cfsnate
Copy link
Author

cfsnate commented Apr 4, 2025

So when running pr-agent as an AWS lambda function, it seems those configuration options are overridden by Lambda. You can't even set the AWS_ACCESS_KEY_ID and secret envs

AWS Credential Provider Chain

Will investigate further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants