title: Unable to upload files to S3 , Access denied
body: <p>I am running an EC2 instance (with an IAM role which got AmazonS3FullAccess), now I am running a nodejs server in it and trying to upload a file to s3 bucket (public access) but getting Access Denied 403 Error.
  Since the EC2 got S3 access, didn't provide accessKey/secret in node
  <a href="https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-iam.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-iam.html</a></p>
  <pre><code>const AWS = require('aws-sdk');
  const s3 = new AWS.S3();
    const params = {
          Bucket: 'sample_name', // pass your bucket name
          Key: 'filename',
          Body: &quot;&lt;p&gt;Hey&lt;/p&gt;&quot;,
          ContentDisposition: 'inline',
          ContentType: 'text/html',
      };
      s3.upload(params, function (s3Err, data) {
          if(s3Err) throw s3Err;
          console.log(data)
      })
  </code></pre>
  <p>could someone please help me on this?
  Thanks in advance</p>