title: Allowing access to only a single file in AWS S3 from IAM policy
body: <p>I am trying to allow access to only a particular file within a S3 folder &amp; tried below IAM policy</p>
  <pre><code>&quot;Version&quot;: &quot;2012-10-17&quot;,
  &quot;Statement&quot;: [
      {
          &quot;Sid&quot;: &quot;VisualEditor0&quot;,
          &quot;Effect&quot;: &quot;Allow&quot;,
          &quot;Action&quot;: [
              &quot;s3:GetLifecycleConfiguration&quot;,
              &quot;s3:GetBucketTagging&quot;,
              &quot;s3:GetInventoryConfiguration&quot;,
              &quot;s3:GetObjectVersionTagging&quot;,
              &quot;s3:ListBucketVersions&quot;,
              &quot;s3:GetBucketLogging&quot;,
              &quot;s3:ListBucket&quot;,
              &quot;s3:GetAccelerateConfiguration&quot;,
              &quot;s3:GetBucketPolicy&quot;,
              &quot;s3:GetObjectVersionTorrent&quot;,
              &quot;s3:GetObjectAcl&quot;,
              &quot;s3:GetEncryptionConfiguration&quot;,
              &quot;s3:GetBucketObjectLockConfiguration&quot;,
              &quot;s3:GetIntelligentTieringConfiguration&quot;,
              &quot;s3:GetBucketRequestPayment&quot;,
              &quot;s3:GetObjectVersionAcl&quot;,
              &quot;s3:GetObjectTagging&quot;,
              &quot;s3:GetMetricsConfiguration&quot;,
              &quot;s3:GetBucketOwnershipControls&quot;,
              &quot;s3:GetBucketPublicAccessBlock&quot;,
              &quot;s3:GetBucketPolicyStatus&quot;,
              &quot;s3:ListBucketMultipartUploads&quot;,
              &quot;s3:GetObjectRetention&quot;,
              &quot;s3:GetBucketWebsite&quot;,
              &quot;s3:GetBucketVersioning&quot;,
              &quot;s3:GetBucketAcl&quot;,
              &quot;s3:GetObjectLegalHold&quot;,
              &quot;s3:GetBucketNotification&quot;,
              &quot;s3:GetReplicationConfiguration&quot;,
              &quot;s3:ListMultipartUploadParts&quot;,
              &quot;s3:GetObject&quot;,
              &quot;s3:GetObjectTorrent&quot;,
              &quot;s3:GetBucketCORS&quot;,
              &quot;s3:GetAnalyticsConfiguration&quot;,
              &quot;s3:GetObjectVersionForReplication&quot;,
              &quot;s3:GetBucketLocation&quot;,
              &quot;s3:GetObjectVersion&quot;
          ],
          &quot;Resource&quot;: [
              &quot;arn:aws:s3:::prod-bucket/folder1/folder2/*&quot;,
              &quot;arn:aws:s3:::prod-bucket/folder3/folder4/my_file.csv&quot;,
          ]
      }
  ]
  </code></pre>
  <p>I am able to read all objects inside folder2 but while trying to read the my_file.csv inside folder4 it is not able to fetch it. Is there something wrong with the syntax ? I tried multiple ways but couldn't figure out how to restrict to read only a particular file .</p>