Reputation: 1599
I have a s3 bucket.
I am using serverless to create a lambda function to read from s3.
Everything works very well.
I want to add a lifecycle rule to this s3 bucket to delete files from s3 after few days using the serverless framework.
How can this be done in serverless.yml file ?
Upvotes: 1
Views: 2696
Reputation: 183
You can follow the aws documentation to configure the life cycle rule for s3 :
ex in YAML format :
# configure object lifecyle
LifecycleConfiguration:
Rules:
-
ExpirationInDays: 30
Prefix: '/'
Status: Enabled
Upvotes: 3