for a project with a partner company, I store files to their S3 bucket (already used in production). Now I have a requirement for a lambda function which should be triggered when a new file is uploaded to the bucket.
To make installation of the function for different environment seamless through the CI of my customer, I wanted to use serveless framework. Surprisingly the setup from scratch worked frictionless, but I am now stuck with the problem that our source S3 bucket exists already in production and when I am running the deploy command for an existing bucket I receive an error message that the bucket already exists:
An error occurred: S3Bucket... - ... already exists.
I read that serverless (or Cloudformation?) keeps track of the existence of a bucket which it has been creating itself, so that subsequent executions of the deploy command don’t try to re-create the resource, just like a DB migration framework would not execute the same migration twice. From my experience these kind of commands usually provide something like a
--fake option to be able to achieve a fake in-sync status of the tool.
Is there anything comparable in the serverless command options that I am not aware of? Or is there a best practice that you can recommend?