title: Unable to load AWS credentials from any provider in the chain - profile file cannot be null
body: <p>I'm trying to use AmazonSNS in my Spring Boot application and I'm able to use it locally, but as soon as I'm deploying it on my development server, I'm getting this error:</p>
  
  <pre><code>Caused by: com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@46a123e4: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/ , com.amazonaws.auth.profile.ProfileCredentialsProvider@44bc2449: profile file cannot be null]
  </code></pre>
  
  <p>If I don't get it wrong, my server is not able to get any AWS credentials. I don't understand why, because AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set as environment variables. My code looks like that:</p>
  
  <pre><code>private AmazonSNS amazonSNS;
  
  @Autowired
  public AmazonSNSPublisherService() {
      this.amazonSNS = AmazonSNSClientBuilder.standard().withCredentials(DefaultAWSCredentialsProviderChain.getInstance()).withRegion("eu-west-1").build();
  }
  </code></pre>
  
  <p>I tried this: </p>
  
  <pre><code>this.amazonSNS = AmazonSNSClientBuilder.standard().withRegion("eu-west-1").build();
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>this.amazonSNS = AmazonSNSClientBuilder.standard().withCredentials(new EnvironmentVariableCredentialsProvider()).withRegion("eu-west-1").build();
  </code></pre>
  
  <p>But I'm always getting the same error.</p>