Reputation: 65
I am developing an Amazon Machine Learning application and am reading my data from amazon s3. I ran into a read permission error and found a solution using amazon explorer. I was wondering if there is a way to grant Amazon ML read-write permissions using code , maybe using aws cli or via boto sdk.
Upvotes: 1
Views: 561
Reputation: 1
Just to give an answer. Create a folder in your bucket. Put the file in the folder. And make sure:
"Resource": "arn:aws:s3:::bucketname/foldername/*"
"s3:prefix": "foldername/*"
NOT your filename
Upvotes: 0
Reputation: 4470
I'll answer solutions for aws-cli.
After creating S3 bucket policy(ml_bucket_policy.json
) based on the developer guide, just run $ aws cli s3api put-bucket-policy
command to assign the bucket policy.
$ aws s3api put-bucket-policy --bucket YOUR_BUCKET_NAME --policy file://ml_bucket_policy.json
Be warned that you need two kinds of bucket policy.
Upvotes: 2