Skip to content

Instantly share code, notes, and snippets.

@bromanko
Created February 3, 2017 21:47
Show Gist options
  • Save bromanko/f8d1b4b130c3de4e5315805b111ed8d5 to your computer and use it in GitHub Desktop.
Save bromanko/f8d1b4b130c3de4e5315805b111ed8d5 to your computer and use it in GitHub Desktop.
S3 No Deletes Policy
{
"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