AWS Java SDK - Unable to find a region via the region provider chain

后端 未结 7 1944
悲哀的现实
悲哀的现实 2020-12-05 17:17

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

7条回答
  •  遥遥无期
    2020-12-05 17:44

    You can try this as below

    BasicAWSCredentials creds = new BasicAWSCredentials("your-accessKey", "your-secretKey");
    AmazonSNS snsClient = AmazonSNSClientBuilder.standard()
            .withCredentials(new AWSStaticCredentialsProvider(creds))
            .withRegion(Regions.US_EAST_1).build();
    

提交回复
热议问题