Skip to content

Instantly share code, notes, and snippets.

@nachoab
Created November 14, 2016 13:19
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 nachoab/b19379a0bcf318980a6760187f089177 to your computer and use it in GitHub Desktop.
Save nachoab/b19379a0bcf318980a6760187f089177 to your computer and use it in GitHub Desktop.
AWS S3 user folder policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Federated": "cognito-identity.amazonaws.com" },
"Action": ["s3:ListBucket"],
"Resource": ["arn:aws:s3:::BUCKET_NAME"],
"Condition": {"StringLike": {"s3:prefix": ["${cognito-identity.amazonaws.com:sub}/*"]}}
},
{
"Effect": "Allow",
"Principal": { "Federated": "cognito-identity.amazonaws.com" },
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": ["arn:aws:s3:::BUCKET_NAME/${cognito-identity.amazonaws.com:sub}/*"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment