amazon web services - How do I access S3 buckets from my EC2 instance? -
i'm new aws , looking bucket policy enable ec2 servers access s3 buckets on same account. tried using policy enables account:
{ "sid": "addcannedacl", "effect": "allow", "principal": { "aws": "arn:aws:iam::account-number:root" }, "action": "s3:", "resource": "arn:aws:s3:::my-bucket/" } ] }
but got access denied on ec2. i've found this: http://docs.aws.amazon.com/iam/latest/userguide/reference_policies_elements.html
#principal "principal": { "service": [ "ec2.amazonaws.com", "datapipeline.amazonaws.com" ] }
which supposed enable ec2. when editing policy "we encountered internal error. please try again." appreciated.
first thing note linux user (e.g. root above) not iam/aws user. iam user can created , authenticated through id , private key. (and assume you'll want avoid using root account such purposes)
when go s3 manager, should able click on bucket , edit permissions. there, should able use aws policy generator. there numerous sample policies online well.
best practice add permissions group of users, not 1 user. @ first, may find not providing overall permissions required, coming error.
you can follow directions here:
https://docs.aws.amazon.com/amazons3/latest/dev/example-bucket-policies.html
Comments
Post a Comment