Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipe1982/20a634ebbae0cd840f705213eca430bf to your computer and use it in GitHub Desktop.
Save felipe1982/20a634ebbae0cd840f705213eca430bf to your computer and use it in GitHub Desktop.
Sample Athena Results S3 Policy for Restricted Data
{
"Version": "2012-10-17",
"Id": "Policy1523289797898",
"Statement": [
{
"Sid": "DenyRestrictedResultsAccess",
"Effect": "Deny",
"NotPrincipal": {
"AWS": [
"arn:aws:iam::{{ aws_account_id }}:user/{{ aws_user_name }}"
]
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::aws-athena-query-results-{{ aws_account_id }}-us-east-1/*",
"Condition": {
"StringEquals": {
"s3:ExistingObjectTag/restriced_data": "True"
}
}
},
{
"Sid": "DenyPolicyUpdates",
"Effect": "Deny",
"NotPrincipal": {
"AWS": [
"arn:aws:iam::{{ aws_account_id }}:user/{{ aws_user_name }}"
]
},
"Action": "s3:PutBucketPolicy",
"Resource": "arn:aws:s3:::aws-athena-query-results-{{ aws_account_id }}-us-east-1"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment