title: Restricting S3 bucket access to a VPC
body: <p>I am trying to apply the following policy in order to restrict <code>my_bucket</code>'s access to a particular VPC.</p>
  <p>When I try to apply this as a bucket policy, I get an <code>Policy has an invalid condition key - ec2:Vpc</code>.</p>
  <p>How do I correct this?</p>
  <pre class="lang-json prettyprint-override"><code>{
     &quot;Version&quot;: &quot;2012-10-17&quot;,
     &quot;Statement&quot;: [
        {
           &quot;Effect&quot;: &quot;Deny&quot;,
           &quot;Principal&quot;: {
              &quot;AWS&quot;: &quot;*&quot;
           },
           &quot;Action&quot;: &quot;*&quot;,
           &quot;Resource&quot;: &quot;arn:aws:s3:::my_bucket/*&quot;,
           &quot;Condition&quot;:{
              &quot;StringNotEquals&quot;: {
                 &quot;ec2:Vpc&quot;: &quot;arn:aws:ec2:region:account:vpc/vpc-ccccccc&quot;
              }
           }
        }
     ]
  }
  </code></pre>