I have a question about the steps written to upgrade serverless from v2 to v3.
The Upgrading to V3 Document says that to update lambda hashing algorithm to the one that v3 supports (i.e. 20201221), we need to do 2 steps:
1. Enable the new hashing mechanism in v2 by setting:
provider:
lambdaHashingVersion: 20201221
2. Redeploy with code or configuration changes in all functions.
...
Alternatively, you can use the --enforce-hash-update helper:
2.1. Run serverless deploy with the --enforce-hash-update flag: that flag will force changes by temporarily overriding the Lambda function descriptions (there is no runtime impact).
2.2. Run serverless deploy without the flag above to restore the descriptions on all Lambda functions.
I have a doubt what version of serverless should I use when doing the step 2.
The step1 clearly mentions that we should use serverless v2, but nothing is mentioned for the step2.
I can think of 2 ways to interpret what is written:
Interpretation 1:
- In V2, update serveless file to add
lambdaHashingVersion: 20201221
and do serverless deploy with the --enforce-hash-update flag - In V2, do serverless deploy again but with no extra flag
- Remove
lambdaHashingVersion: 20201221
from serveless file, make serverless version to v3, do serverless deploy with no extra flag
Interpretation 2:
- In V2, update serveless file to add
lambdaHashingVersion: 20201221
and do serverless deploy with with no extra flag - Remove
lambdaHashingVersion: 20201221
from serveless file, make serverless version to v3, do serverless deploy with --enforce-hash-update flag - Keeping v3, do serverless deploy with with no extra flag
Maybe I am not understanding the document clearly but can someone who has upgraded from v2 to v3 please let me know what steps you followed to update lambda hashing algorithm?
Thank you.