Bug description When using any of the AWS / Bedrock models, the documentation states "The region property is compulsory." But this should not be the case since SpringAI uses the AWS SDK for Java, and it provides a default region resolver. This will automatically look in AWS's configuration files such as ~.aws/config, which is where AWS developers would often set the region, especially if profiles are involved. See https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/region-selection.html
Environment Currently observed in SpringAI 1.0.0, any model.
Steps to reproduce Configure a local environment for AWS usage with the "aws configure" command, setting any region other than us-east-1. Write code to use any Bedrock model, do not set the region using "spring.ai.bedrock.aws.region". Enable your bedrock models in the same region configured above. Run and get a permission error, because SpringAI has not followed the AWS Java SDK's default behavior.
Expected behavior I would expect SpringAI, using the AWS SDK for Java, to follow the same (or similar) region resolution rules, certainly not omitting the shared config file at ~.aws/config
Minimal Complete Reproducible example See above for steps to reproduce
Comment From: maxjiang153
You can use Spring AI and Spring Cloud AWS together to manage IAM identity and region selection.
Spring AI is fully compatible with Spring Cloud AWS; besides region resolution, it also provides a variety of IAM authentication mechanisms, such as Instance profile, STS assume roles, etc.
Comment From: markpollack
We should add more information to the documentation. @maxjiang153 would you be able to provide a working code snippit please?