Last active
January 25, 2019 11:23
-
-
Save prabhatsharma/d324e43760c3e37ef049ef9ff8cf52c3 to your computer and use it in GitHub Desktop.
s3-bucket-policy to restrict access only from certain VPCs
This file contains hidden or 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": "Policy1415115909153", | |
| "Statement": [ | |
| { | |
| "Sid": "Access-to-specific-VPCs-only", | |
| "Principal": "*", | |
| "Action": "s3:*", | |
| "Effect": "Deny", | |
| "Resource": [ | |
| "arn:aws:s3:::bucket-name", | |
| "arn:aws:s3:::bucket-name/*" | |
| ], | |
| "Condition": { | |
| "StringNotEquals": { | |
| "aws:sourceVpc": [ | |
| "vpc-123", | |
| "vpc-456", | |
| "vpc-789" | |
| ] | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment