Skip to content

Instantly share code, notes, and snippets.

@mengjiann
Created April 2, 2019 16:18
Show Gist options
  • Save mengjiann/5fed0cbdadc79b4a187cb5f8755a3995 to your computer and use it in GitHub Desktop.
Save mengjiann/5fed0cbdadc79b4a187cb5f8755a3995 to your computer and use it in GitHub Desktop.
Restricting AWS S3 Bucket Access from Defined IP Address
{
"Version": "2012-10-17",
"Id": "S3PolicyIPRestrict",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::bucket-name/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"10.0.0.1/32",
"10.0.0.2"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment