Whitelisting files in Serverless

By default, the Serverless framework will deploy every file in the project directory. In most cases, this is not what you want. serverless.yml offers the option to control which files will be deployed to your cloud provider by using the exclude / include parameters.

Due to the way these parameters are implemented, it is not possible to create a whitelist of files by only specifying include. In addition to the whitelist, you first have to exclude everything for the include parameter to actually have an effect:

package:
  exclude:
    - ./**
  include:
    - main.py
    - (…)

Published