Skip to content

Instantly share code, notes, and snippets.

@ChenLiZhan
Created July 19, 2018 03:37
Show Gist options
  • Save ChenLiZhan/44778993cc9a4ca22b2882b3a2e117b1 to your computer and use it in GitHub Desktop.
Save ChenLiZhan/44778993cc9a4ca22b2882b3a2e117b1 to your computer and use it in GitHub Desktop.
S3 bucket policy for hosting static website with IP limitation
{
"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