title: Amazon S3: Grant anonymous access from IP (via bucket policy)
body: <p>I have a Amazon S3 bucket and would like to make it available to scripts on a certain machine, whithout the need to deploy login credentials. So my plan was to allow anonymous access only from the IP of that machine. I'm quite new to the Amazon cloud and bucket policies look like the way to go. I added the following policy to my bucket:</p>
  
  <pre><code>{
      "Version": "2008-10-17",
      "Id": "S3PolicyId1",
      "Statement": [
          {
              "Sid": "IPAllow",
              "Effect": "Allow",
              "Principal": {
                  "AWS": "*"
              },
              "Action": "s3:*",
              "Resource": "arn:aws:s3:::name_of_my_bucket/*",
              "Condition": {
                  "IpAddress": {
                      "aws:SourceIp": [
                          "my_ip_1/24",
                          "my_ip_2/24"
                      ]
                  }
              }
          }
      ]
  }
  </code></pre>
  
  <p>But anonymous access still does not work. For testing, I granted access to "Everyone" in the S3 management console. That works fine, but is obviously not what I want to do. ;-) Any hint what I'm doing wrong and how to get this working?</p>
  
  <p>My use case is some data processing using EC2 and S3, so access control by IP would be much simpler than fiddling around with user accounts. If there's a simpler solution, I'm open for suggestions.</p>