Created
April 2, 2019 16:18
-
-
Save mengjiann/5fed0cbdadc79b4a187cb5f8755a3995 to your computer and use it in GitHub Desktop.
Restricting AWS S3 Bucket Access from Defined IP Address
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": "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