Created
July 19, 2018 03:37
-
-
Save ChenLiZhan/44778993cc9a4ca22b2882b3a2e117b1 to your computer and use it in GitHub Desktop.
S3 bucket policy for hosting static website with IP limitation
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": "2012-10-17", | |
"Id": "S3PolicyId1", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::BUCKET_NAME/*", | |
"Condition": { | |
"IpAddress": { | |
"aws:SourceIp": "IP_ADDRESS" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment