I have gone through the question titled \"Setting the AWS region programmatically 1\" but it doesn\'t provide all the answers I need.
Q1: I\'m getting a SDKCli
Well steps you can take to investigate:
Please make sure your Lambda function and S3 are in the same region. (When you use ProviderChain, it will pick up the region from the Lambda function
Also, You should not need to specify the BasicCredentials(aws-key..etc) if you are using Lambda.
Please read about Lambda Permission model (http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html):
Basically, the Lambda role that you assign should have permission to access S3.
All you need to configure S3 is pretty much:
private static final AmazonS3 s3Client =
AmazonS3ClientBuilder.defaultClient();
To test it locally, make sure you have configured the AWS Credentials locally.
You can check if you have the credentials, if you go into .aws/credentials (This will contain the "aws-access-key", "aws-secret-key")
http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html
To set up your credentials locally, all you need to do is run the AWS Cli command: aws configure (http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.htm)