Packaging should not include service level patterns
We have the following config which adds all python code also into the warmUpPluginOfficeHoursWarmer.zip. I tried various variations to exclude the files and the only thing that worked is setting package.individually to true or moving the package block into the function. Moving the package block into the function does not apply the patterns though and we will end up with a large zip file.
Imo package.patterns should not be joined to package the warmer function.
functions:
app:
handler: wsgi_handler.handler
timeout: 30
layers:
- Ref: PythonRequirementsLambdaLayer
warmup:
officeHoursWarmer:
enabled: prod
package:
individually: false
patterns:
- "!**"
- "serverless_sdk*/**"
- "app/**"
- "module1/**"
- "module2/**"
- "module3/**"
- "*.py"
What worked:
functions:
app:
handler: wsgi_handler.handler
timeout: 30
layers:
- Ref: PythonRequirementsLambdaLayer
package:
patterns:
- "!**"
- "serverless_sdk*/**"
- "app/**"
- "module1/**"
- "module2/**"
- "module3/**"
- "*.py"
warmup:
officeHoursWarmer:
enabled: prod
package:
individually: true
Hi @estahn ,
Cascading the package settings (i.e. joining the patterns set at package level to the ones set at the function) is the behaviour of the Serverless framework.
You can also exclude the packages from the warmer config:
package:
individually: false
patterns:
- "!**"
- "serverless_sdk*/**"
- "app/**"
- "module1/**"
- "module2/**"
- "module3/**"
- "*.py"
custom:
warmup:
officeHoursWarmer:
package:
patterns:
- "!serverless_sdk*/**"
- "!app/**"
- "!module1/**"
- "!module2/**"
- "!module3/**"
- "!*.py"
functions:
app:
handler: wsgi_handler.handler
timeout: 30
layers:
- Ref: PythonRequirementsLambdaLayer
warmup:
officeHoursWarmer:
enabled: prod
Closing since a solution has been provided and there has been no more responses