Allow others to upload files in your Amazon S3 bucket
Let us explore how can we allow others to upload files in our AWS account using AWS console
01. Create user - Login to to AWS console --> Select IAM --> Users --> Add User --> Username --> Password
02. Create Amazon s3 bucket --> Select S3 --> Create Bucket --> Bucket Name --> Create Bucket
Note: Keep Check Box Checked for Block All public Access, and other options as default.
03. Create Amazon s3 bucket policy --> Select Bucket --> Bucket Policy --> Edit --> Add following bucket policy as follows.
Note: Make sure to replace Bucke_Name with your actual bucket name.
Note: Make sure to replace Bucke_Name with your actual bucket name.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowToListBucket",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<YourAmzon 12 Digit A/c No.>:user/<Bucket_Name>"
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<Bucket_Name>"
}
]
}
04. Create user policy - Select User --> Add Inline Policy --> Json. Add following policy for User
Note: Make sure to replace Bucket_Name, and Folder_name with your actual bucket name and folder name.
{
]
}
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::<Bucket_Name>/<Folder_Name>/*"
}]
}
Comments
Post a Comment