Hey,
I’ve been trying to implement a serverless.yml for an S3 bucket, which triggers a lambda function, and then deletes the objects after a week.
So i’m defining the s3 event under the functions, which creates an S3 bucket, then under Resources i define the same s3 bucket with the lifecycle policy. And i get the following error:
An error occurred: S3BucketBucket1mediaupload - bucket-1 already exists in stack arn:aws:cloudformation:us-east-1:**********:stack/my-service-prod/
Is my best bet to define the whole bucket (s3 event and lifecycle policy, link to lambda) in the Resources?
Thanks so much