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

Feature: Support for access aws bedrock through role arn directly and retrieve the AKSK from boto3.Session directly #538

Open
richzw opened this issue Jun 14, 2024 · 0 comments

Comments

@richzw
Copy link

richzw commented Jun 14, 2024

Currently, if we want to access the aws bedrock through role arn, we should

bedrock_role="arn:aws:iam::xxxx:role/bedrock-access-role" 
credentials = boto3.client('sts').assume_role(RoleArn=bedrock_role,RoleSessionName='assume-role')

client = AnthropicBedrock(aws_region="us-west-2", aws_access_key=credentials['Credentials']['AccessKeyId'], aws_secret_key=credentials['Credentials']['SecretAccessKey'])

Should we support access aws bedrock through role arn directly? such as

client = AnthropicBedrock(aws_region="us-west-2", aws_role_arn="arn:aws:iam::xxxx:role/bedrock-access-role")

Another feature is that we could get the AKSK and region from boto3.Session directly, and those data from the credential file under the default .aws folder.

c= boto3.Session()
cr=c.get_credentials().get_frozen_credentials()
cr.access_key
cr.secret_key
c.region_name

If one of them could be approved, May I push the related PR?

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

No branches or pull requests

1 participant