question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use serverless remove when using existing buckets with s3 events

See original GitHub issue

Bug Report

Description

Observed with latest version of serverless 1.55.1

  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)

  2. 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.
  1. What should’ve happened?

Stack should delete.

  1. 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:open
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
nickygbcommented, Sep 28, 2020

No worries, thank you for the information.

Still experiencing the same issue when I use DependsOn, on the bucket, and reference the lambdas, I shall do some investigations and report back with anything I find.

@joshuaduffy I’m experiencing the same problem, could you solve it?

1reaction
spacewaterbearcommented, Apr 19, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found