title: AWS Polly Java Client gives error: Unable to load region information from any provider in the chain
body: <p>I am using the JAVA SDK from AWS to create a Polly client.
  Like this:</p>
  
  <pre><code>BasicAWSCredentials awsCreds = new BasicAWSCredentials("&lt;IAM access Key&gt;", "IAM secret key&gt;");
  
      AmazonPollyClient apClient = (AmazonPollyClient) AmazonPollyClientBuilder.standard()
              .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
              .build();
  
  
      SynthesizeSpeechRequest tssRequest = new SynthesizeSpeechRequest();
      tssRequest.setText(&lt;text&gt;);
      tssRequest.setVoiceId(&lt;voiceid&gt;);
      tssRequest.setOutputFormat(OutputFormat.Mp3);
      SynthesizeSpeechResult tssResult = apClient.synthesizeSpeech(tssRequest);
  </code></pre>
  
  <p>When I run this code, I get the following error message:</p>
  
  <blockquote>
    <p>Exception in thread "main" com.amazonaws.SdkClientException: Unable to
    load region information from any provider in the chain    at
    com.amazonaws.regions.AwsRegionProviderChain.getRegion(AwsRegionProviderChain.java:56)
      at
    com.amazonaws.client.builder.AwsClientBuilder.setRegion(AwsClientBuilder.java:319)
      at
    com.amazonaws.client.builder.AwsClientBuilder.configureMutableProperties(AwsClientBuilder.java:295)
      at
    com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:38)
      at com.eoffice.aws.speech.Polly.main(Polly.java:42)</p>
  </blockquote>
  
  <p>I checked the credentials using the IAM Policy Simulator. This works fine, permissions are OK.</p>
  
  <p>The method to set the Region in the ClientBuilder is NOT visible for the AmazonPollyClientBuilder, so I have no (Java SDK) way to specify the region.</p>
  
  <p><strong>Update:</strong>
  When I just ask the defaultAwsREgionProviderChain, I get the same error message</p>
  
  <pre><code>DefaultAwsRegionProviderChain defaultAwsRegionProviderChain = new DefaultAwsRegionProviderChain();
  System.out.println(defaultAwsRegionProviderChain.getRegion());
  </code></pre>
  
  <p><strong>Updat 2:</strong>
  When I create a config file in de .aws folder with the following content:</p>
  
  <blockquote>
    <p>[default] 
    region = eu-west-1</p>
  </blockquote>
  
  <p>It works, but I need a way to set this without relying on the file system.</p>