Serverless: how to remove one function

Phong Vu picture Phong Vu · Jun 15, 2018 · Viewed 8.4k times · Source

I am using serverless to deploy my API on AWS.

In serverless, it allows to deploy a single function:

sls deploy -f <function name>

But it doesn't allow to remove a single function:

sls remove // will remove all functions.

Is there any way to remove single function which won't impact to other functions?

Answer

Phong Vu picture Phong Vu · Jun 15, 2018

@justin.m.chase suggested:

Simply remove the function in serverless.yml, then run full deploy

sls deploy

the function is removed (Lambda + API Gateway). Perfecto!