AWS SDK in general has a good way for looking for configuration with minimal intervention / configuration from the developer, as long as you make sure you have the necessary configuration in place, either it's giving necessary IAM Policy access or having temporary credentials placed in a config file.
Please have a deep dive into
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html
Which basically suggests you don't need to specify anything if you assign the right policy to the resource you are running your code at.