Created
September 4, 2018 23:05
-
-
Save KazChe/df66338db792ebe12aba5e8349201f48 to your computer and use it in GitHub Desktop.
AWS S3 bucket policy allowing only certain IP addresses to GET from it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2008-10-17", | |
"Id": "S3PolicyId1", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::<ADD_YOUR_BUCKET_NAME_HERE>/*", | |
"Condition": { | |
"IpAddress": { | |
"aws:SourceIp": [ | |
"<ADD_IP_ADDRESS_HERE>/32", | |
"<ADD_IP_ADDRESS_HERE>/32" | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment