Created
March 22, 2015 19:17
-
-
Save dulacp/41c7a51c41c3b5fd66ae to your computer and use it in GitHub Desktop.
AWS S3 Policy to give access to one user to one bucket
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
USERNAME="your-username" | |
BUCKETNAME="my-awesome-bucket-name" | |
aws iam put-user-policy --user-name $USERNAME --policy-name AmazonS3FullAccess-$USERNAME --policy-document '{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket", | |
"s3:GetBucketLocation", | |
"s3:ListBucketMultipartUploads" | |
], | |
"Resource": "arn:aws:s3:::'$BUCKETNAME'", | |
"Condition": {} | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:AbortMultipartUpload", | |
"s3:DeleteObject", | |
"s3:DeleteObjectVersion", | |
"s3:GetObject", | |
"s3:GetObjectAcl", | |
"s3:GetObjectVersion", | |
"s3:GetObjectVersionAcl", | |
"s3:PutObject", | |
"s3:PutObjectAcl", | |
"s3:PutObjectAclVersion" | |
], | |
"Resource": "arn:aws:s3:::'$BUCKETNAME'/*", | |
"Condition": {} | |
} | |
] | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment