title: How to check if my EC2 has access to s3 bucket in same account?
body: <p>I have an ec2 instance working on ubuntu 18.4.
  and an s3 for in a same region.</p>
  <p>I want my ec2 to connect to s3. My S3 is in a default state I just created it and have uploaded a file int it. Currently, the access state is &quot;Bucket and objects not public&quot;.</p>
  <p>I created a role which holds a policy</p>
  <pre><code>&quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Action&quot;: &quot;*&quot;,
              &quot;Resource&quot;: [
                  &quot;arn:aws:s3:::bucketname&quot;,
                  &quot;arn:aws:s3:::bucketname/*&quot;
              ]
          }
      ]
  </code></pre>
  <p>have attached the role to Ec2 instance.</p>
  <p>I want to check if my ec2 will be able to access the S3 and how would I do that?</p>
  <p>and</p>
  <p>My ec2 is a web server which will access buckets for images, do I have to do anything else along with these steps?</p>