amazon s3 - Using two policies together in a single S3 bucket -
i new amazon s3 , created first bucket. need 2 important policies implemented on bucket follows:
first, policy allowing downloads own website (via http referrer)
secondly, want make objects in bucket public.
i have got 2 different codes of policies needs, can't put them achieve said goals. please me joining these policies achieve want.
for allowing referrer downloads:
{ "version": "2012-10-17", "id": "http referer policy example", "statement": [ { "sid": "allow requests originated www.example.com , example.com", "effect": "allow", "principal": "*", "action": "s3:getobject", "resource": "arn:aws:s3:::bucket/*", "condition": { "stringlike": { "aws:referer": [ "url/*", ] } } } ] }
for making objects public:
{ "sid": "...", "action": [ "s3:getobject" ], "effect": "allow", "resource": "arn:aws:s3:::bucket/*", "principal": { "aws": [ "*" ] } }