# Setting up S3 bucket policy

**URL:** <https://forum.serverless.com/t/setting-up-s3-bucket-policy/787>\
**Category:** Serverless Framework\
**Created:** [November 18, 2016, 10:57pm UTC](https://forum.serverless.com/t/setting-up-s3-bucket-policy/787 "2016-11-18T22:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dionysio](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@dionysio](https://forum.serverless.com/u/dionysio)\
**Post date:** [November 18, 2016, 10:57pm UTC](https://forum.serverless.com/t/setting-up-s3-bucket-policy/787/1 "2016-11-18T22:57:00Z")

</div>

I have two S3 buckets set up in my serverless config in the resources section. Now I want to make one of them publicly accessible (so the GetObject operation is available to anyone). How do I attach the bucket policy to the config?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [November 20, 2016, 11:00pm UTC](https://forum.serverless.com/t/setting-up-s3-bucket-policy/787/2 "2016-11-20T23:00:41Z")

</div>

You can create [BucketPolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html) resources in the `Resources` section, and refer to your bucket by using the `Ref: LogicalId` [CloudFormation syntax](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html).

---

<div class="post-metadata">

**Author:** ![dionysio](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@dionysio](https://forum.serverless.com/u/dionysio)\
**Post date:** [November 21, 2016, 12:22am UTC](https://forum.serverless.com/t/setting-up-s3-bucket-policy/787/3 "2016-11-21T00:22:01Z")

</div>

Thank you rowanu, that was exactly what I needed 🙂
