title: Unable to load credentials from any of the providers in the chain
body: <p>Trying to use S3 client in my ECS app for uploading files into S3 bucket (let's call it <code>bucket1</code>),<br />
  S3 client is instantiated as follows:</p>
  <pre><code>import software.amazon.awssdk.services.s3.S3Client;
   
  private S3Client getClient(){
  
  
      return S3Client.builder().build();
  }
  </code></pre>
  <p>Task definition has been configured to use <code>ecsTaskExecutionRole</code> as &quot;Task execution role&quot;, so I have added the following permissions policy to it:</p>
  <pre><code>{
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Action&quot;: [
                  &quot;s3:AbortMultipartUpload&quot;,
                  &quot;s3:GetBucketLocation&quot;,
                  &quot;s3:GetObject&quot;,
                  &quot;s3:ListBucket&quot;,
                  &quot;s3:ListBucketMultipartUploads&quot;,
                  &quot;s3:PutObject&quot;
              ],
              &quot;Resource&quot;: [
                  &quot;arn:aws:s3:::bucket1&quot;,
                  &quot;arn:aws:s3:::bucket1/*&quot;
              ]
          }
      ]
  }
  </code></pre>
  <p>The same permissions policy has been added to <code>ecsInstanceRole</code> as well.</p>
  <p>When I try to upload something, the following exception is dropped:</p>
  <pre><code>software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(): Profile file contained no credentials for profile 'default': ProfileFile(profiles=[]), ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Failed to load credentials from IMDS.]
  </code></pre>
  <p>Kind of lost here - am I supposed to specify AWS credentials in the list of environment variables? How to pass credentials otherwise?</p>
  <p>By the way, &quot;Task role&quot; has been set to &quot;None&quot;, in task definition, if that matters</p>