Cannot use serverless remove when using existing buckets with s3 events
See original GitHub issueBug Report
Description
Observed with latest version of serverless 1.55.1
-
What did you do? Ran
serverless remove
to delete a stack that contains a number of lambdas that are attached an existing bucket (as detailed in https://serverless.com/framework/docs/providers/aws/events/s3/#using-existing-buckets) -
What happened?
Stack failed to delete with:
An error occurred: ResourceContentEventCustomS31 - Failed to delete resource. The specified bucket does not exist See details in CloudWatch Log: 2019/10/30/[$LATEST]d80e4ccd09fc4483bf18b9e3c3b63ec3.
- What should’ve happened?
Stack should delete.
- What’s the content of your
serverless.yml
file?
Bucket created in resources section…
resources:
Resources:
ContentBucket:
Type: AWS::S3::Bucket
… and referenced with existing=true
flag
thing:
handler: thing
package:
artifact: ./artifacts/thing.zip
events:
- s3:
bucket: ${self:provider.contentBucket}
events:
- s3:ObjectCreated:*
existing: true
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:9 (1 by maintainers)
Top Results From Across the Web
AWS Lambda Events - S3 - Serverless Framework
The users function is called whenever an object is removed from the bucket. Check out the AWS documentation to learn more about all...
Read more >Serverless Framework: S3 Lambda Trigger with bucket from ...
The existing:true flag only relates to S3 buckets created outside of your serverless project, for buckets that already exist, ...
Read more >Event notification types and destinations - AWS Documentation
For instructions on how to delete versioned objects, see Deleting object versions from a versioning-enabled bucket. You can also use a wildcard s3:ObjectRemoved ......
Read more >serverless-s3-local - npm
Start using serverless-s3-local in your project by running `npm i ... local-bucket functions: webhook: handler: handler.webhook events: ...
Read more >Configuring an S3 Bucket to send events to a Lambda ...
Long story short, you cannot use CloudFormation to configure Lambda event destinations for existing buckets. You will need to do so manually on ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@joshuaduffy I’m experiencing the same problem, could you solve it?
I had the same issue. I deleted the bucket by hand (and the cloudformation associated but not sure it was needed). Then I re-run the pipeline on gitlab (or whatever) and it worked