Re-write Bedrock BedrockAwsConnectionConfiguration
to use AwsCredentialsProvider
and AwsRegionProvider
to manage Amazon Bedrock AI model connections.
With this change, Spring-AI
will provide the capability to customize the AwsCredentialsProvider
and AwsRegionProvider
configurations. Also with this feature, Spring-AI
has capabilities compatible with Spring Cloud AWS
credential management.
Comment From: maxjiang153
@tzolov Could you check this out? I know this is a breakable change. But it's very helpful for some of the projects that are using Spring Cloud AWS and Spring AI for AWS Bedrock usage.
Looking forward to your suggestions.
Comment From: tzolov
Hi @wmz7year, thanks for taking a pick at this.
Before we start reviewing it i have to point that the <artifactId>spring-cloud-aws-starter</artifactId>
is not acceptable.
In fact no boot starter in a library code is ok.
So please cherry pick only the necessary minim of dependency. Often the awspring starters will try to bring the entire AWS ecosystem into your project.
Comment From: maxjiang153
Maybe there is another solution for the compatibility between Spring-AI and Spring-Cloud-AWS.
Sprint AI defined connection properties in BedrockAwsConnectionConfiguration
and created AwsCredentialsProvider
in BedrockAwsConnectionConfiguration
.
But currently, we don't use AwsRegionProvider
to manage the region configuration.
So maybe we can keep the current BedrockAwsConnectionConfiguration
and the other BedrockClients's auto-configuration conditions; maybe only check 'AwsCredentialsProvider' and AwsRegionProvider
, not dependency with BedrockAwsConnectionProperties
.
So this will be compatible with Spring-Cloud-AWS and not necessarily integrated with it.
How do you think about this, if this is ok I'll change the PR @tzolov
Comment From: maxjiang153
Hi @tzolov could you check this out again? I removed spring-cloud-aws dependency and provided new capabilities with custom AwsCredentialsProvider
and AwsRegionProvider
.
Comment From: tzolov
Thank you @wmz7year , PR LGTM