# S3 Bucket event and lifecycle

**URL:** https://forum.serverless.com/t/s3-bucket-event-and-lifecycle/3445
**Category:** Serverless Framework
**Tags:** aws
**Created:** [January 7, 2018, 1:49am UTC](https://forum.serverless.com/t/s3-bucket-event-and-lifecycle/3445 "2018-01-07T01:49:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GuidoS](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/guidos/32/1469_2.png) [@GuidoS](https://forum.serverless.com/u/GuidoS)
#### Post date: [January 7, 2018, 1:49am UTC](https://forum.serverless.com/t/s3-bucket-event-and-lifecycle/3445/1 "2018-01-07T01:49:31Z")

</div>

Hey folks,

I am trying to setup an aws s3 bucket with an event lambda and lifecycle rules. I have not found an example of this and am not able to get a simple example toghether that works for me.

Can you please assist.

The following link is a public gist with my current failing setup.

> <https://gist.github.com/GuidoS/c2ab75f909a51380dd00c3bf5316de28>

---

<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: [January 10, 2018, 12:12am UTC](https://forum.serverless.com/t/s3-bucket-event-and-lifecycle/3445/2 "2018-01-10T00:12:37Z")

</div>

In your `serverless.yml` you’re setting the `LifecycleConfiguration` property inside your Lambda permission resource (i.e. `Type: "AWS::Lambda::Permission"`), which has nothing to do with permissions.

The `LifecycleConfiguration` property belongs in your [CFN bucket definition](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html). [See the comment on line 19 of your gist](https://gist.github.com/GuidoS/c2ab75f909a51380dd00c3bf5316de28#file-serverless-yml-L19).

---

<div class="post-metadata">

### Author: ![GuidoS](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/guidos/32/1469_2.png) [@GuidoS](https://forum.serverless.com/u/GuidoS)
#### Post date: [January 10, 2018, 7:02pm UTC](https://forum.serverless.com/t/s3-bucket-event-and-lifecycle/3445/3 "2018-01-10T19:02:04Z")

</div>

Thank you for your help. That totally worked.
