title: S3: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
body: <p>After configure AWSCLI using command <code>aws configure</code> . I'm trying to download files from S3 bucket to local folder test, using following command</p>
  
  <pre><code>aws s3 sync s3://sourceBucket  ./test --delete
  </code></pre>
  
  <p>but it's throwing following error message</p>
  
  <pre><code>download failed: s3://sourceBucket/jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war to test/jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
  download failed: s3://sourceBucket/jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war to test/jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
  </code></pre>
  
  <p>sourceBucket had following permissions</p>
  
  <p><a href="https://i.stack.imgur.com/Gvfby.png" rel="noreferrer">sourceBucket permissions Image - clickhere</a></p>
  
  <p>When I check List of objects in sourceBucket using this command</p>
  
  <pre><code>aws s3api list-objects --bucket sourceBucket --query 'Contents[].{Key: Key, Size: Size}'
  </code></pre>
  
  <p>following is the output of it</p>
  
  <pre><code>[
      {
          "Key": "jobs/Test/1/slider-test-0.0.1-SNAPSHOT.war", 
          "Size": 2546325
      },
      {
          "Key": "jobs/Test/2/slider-test-0.0.1-SNAPSHOT.war", 
          "Size": 3571598
      }
  ]
  </code></pre>
  
  <p>could some one let me know how to solve this, I need to download the all objects from s3 sourceBucket to local folder test.</p>
  
  <p>Thank you.</p>