title: S3 bucket policy multiple conditions
body: <p>I'm looking to grant access to a bucket that will allow instances in my VPC full access to it along with machines via our Data Center. Without the <code>aws:SouceIp</code> line, I can restrict access to VPC online machines. </p>
  
  <p>I need the policy to work so that the bucket can only be accessible from machines within the VPC AND from my office.</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Id": "Policy1496253408968",
      "Statement": [
          {
              "Sid": "Stmt1496253402061",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:*",
              "Resource": [
                  "arn:aws:s3:::xyz-sam-test/*",
                  "arn:aws:s3:::xyz-sam-test"
              ],
              "Condition": {
                  "StringLike": {
                      "aws:sourceVpc": "vpc-dcb634bf",
                      "aws:SourceIp": "&lt;MY PUBLIC IP&gt;"                                  
                  }
              }
          }
      ]
  }
  </code></pre>