Skip to content

Instantly share code, notes, and snippets.

@temochka
Last active October 7, 2015 20:29
Show Gist options
  • Save temochka/d016c49443c0af58bd7c to your computer and use it in GitHub Desktop.
Save temochka/d016c49443c0af58bd7c to your computer and use it in GitHub Desktop.
IAM policy to deploy to S3 subdirectory via Beanstalk/Dploy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1422638998000",
"Effect": "Allow",
"Action": [
"cloudfront:CreateInvalidation",
"cloudfront:GetDistribution"
],
"Resource": [
"*"
]
}
]
}
{
"Version": "2008-10-17",
"Id": "Policy1422484468213",
"Statement": [,
{
"Sid": "Stmt1422484391361",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::NUMERIC_AWS_ID:user/USERNAME"
},
"Action": ["s3:ListBucket", "s3:GetBucketLocation"],
"Resource": "arn:aws:s3:::BUCKETNAME"
},
{
"Sid": "Stmt1422484466722",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::NUMERIC_AWS_ID:user/USERNAME"
},
"Action": [
"s3:GetObjectAcl",
"s3:DeleteObject",
"s3:PutObjectAcl",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::BUCKETNAME/*"
}
]
}
{
"Version": "2012-10-17",
"Id": "Policy1422484468213",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::387509546542:user/USERNAME"
},
"Action": ["s3:ListBucket", "s3:GetBucketLocation"],
"Resource": "arn:aws:s3:::BUCKETNAME"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::387509546542:user/USERNAME"
},
"Action": [
"s3:GetObjectAcl",
"s3:DeleteObject",
"s3:PutObjectAcl",
"s3:PutObject"
],
"Resource": ["arn:aws:s3:::BUCKETNAME/${aws:username}/*"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment