serverless-python-requirements
serverless-python-requirements copied to clipboard
`sls deploy function` doesn't create new requirements layer version
I have a Django app that I want to deploy in these steps:
- Deploy a single function,
manage
, that is used for running (you guessed it)manage.py
commands - Run the
manage
function to run Django migrations - Deploy the rest of the functions in my Django app
When I attempt (1), though, using sls deploy function -f manage
, I notice that in step (2), a new dependency I just added to my requirements.txt
(since the last deploy of the manage
function) isn't available in the manage
function. Further, I'm using layer: true
in my serverless.yml
, and I noticed that a new Lambda layer version was not created when i ran step (1) - which explains the missing dependency.
How can I continue using a Lambda layer for my Python requirements, while making sure that deploying a single function includes a new version of the requirements layer if needed? Is this a bug in serverless-python-requirements?
Here's a minimal repro: https://github.com/brettdh/serverless-layer-test
Note, however, that the issue also appears to manifest when not using this plugin; sls deploy function
just doesn't seem to update lambda layers at all. For the app that does use this plugin, however, I notice that the requirements layer is not getting updated even when I have added a new dependency to requirements.txt
and do a full deploy (not just one function)
I'll leave this open in case y'all have any insights, but I'm going to also open an issue on serverless/serverless.
Update: opened serverless/serverless#11141.