Created
February 3, 2017 21:47
-
-
Save bromanko/f8d1b4b130c3de4e5315805b111ed8d5 to your computer and use it in GitHub Desktop.
S3 No Deletes Policy
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
{ | |
"Id": "PreventPermanentDeletion", | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:*" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::bucketname", | |
"arn:aws:s3:::bucketname/*" | |
], | |
"Principal": { | |
"AWS": [ | |
"arn:aws:iam::001112223333:user/deleter" | |
] | |
} | |
}, | |
{ | |
"Action": [ | |
"s3:DeleteBucket", | |
"s3:DeleteBucketPolicy", | |
"s3:DeleteObjectVersion", | |
"s3:PutBucketPolicy", | |
"s3:PutBucketVersioning", | |
"s3:PutLifecycleConfiguration", | |
"s3:PutBucketAcl" | |
], | |
"Effect": "Deny", | |
"Resource": [ | |
"arn:aws:s3:::bucketname", | |
"arn:aws:s3:::bucketname/*" | |
], | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::001112223333:user/deleter" | |
] | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment