Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region

Building Serverless Applications with Spring and AWS -Marc Thomas

Creating an Image Resizing Application

The first time I try to run something, it doesn’t work… surprise, surprise…

Anyway… I look online and it says that all the credentials should have been picked up from when I setup the CLI (Command Line Interface). I checked in Eclipse via Window > Preferences > AWS Toolkit, and it all seemed fine. I did set up a profile of awsdeveloper because I wanted to keep it separate from work aws stuff.

Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region. at com.amazonaws.client.builder.AwsClientBuilder.setRegion(AwsClientBuilder.java:436)#

Found the answer in the first stackoverflow question Google found:

“I solved this by adding the AWS_REGION environment variable. E.g. us-east-2. When using Eclipse, you can add this using the Run –> Run Configurations.”

As I was running a JUnit test, I updated the Debug Configuration. 😀

Leave a comment