6
votes

When I try deploy to an existing lambda function configured in serverless.yml as following, it says "An error occurred: ApiLambdaFunction - an-existing-function-name-created-by-my-devops already exists."

functions:
  api:
    name: an-existing-function-name-created-by-my-devops

So it is not allowed to deploy to an existing lambda not created by serverless?

1

1 Answers

2
votes

As Serverless manages your resources via a CloudFormation Stack, you could probably be able to import the lambda function within the UI (Import Existing Resources into a CloudFormation Stack) and do the deploy afterwards again.

I did not try this and there's most probably a better solution though.

Edit: precondition is that you successfully created your stack before adding your desired function.