Created
December 29, 2020 20:16
-
-
Save alecbw/a3bf6af7956c8390b38a5db04e044be6 to your computer and use it in GitHub Desktop.
A policy you can attach to a role to enable the caller to write to S3 buckets (and corresponding Athena tables). NOTE: overwrite and overwrite-partitions require additional permissions
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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:ListBucket", | |
"s3:GetBucketLocation" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::bucket-your-data-is-in", | |
"arn:aws:s3:::bucket-specified-for-athena-query-results", | |
], | |
"Sid": "FindAndScanStagingBuckets" | |
}, | |
{ | |
"Action": [ | |
"s3:GetObject", | |
"s3:PutObject" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::bucket-your-data-is-in/some-subfolder/*", | |
"arn:aws:s3:::bucket-specified-for-athena-query-results/*", | |
], | |
"Sid": "GetAndPutAthenaAndPublicResults3Objects" | |
}, | |
{ | |
"Action": [ | |
"glue:GetTable", | |
"glue:GetDatabase", | |
"glue:GetPartitions" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:glue:us-west-1:YOURAWSACCOUNTID:*" | |
], | |
"Sid": "AccessGlueParts" | |
} | |
], | |
"Version": "2012-10-17" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment