-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/serverless upgrade #1900
Chore/serverless upgrade #1900
Conversation
48c124f
to
c9adda2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks a bunch for the work!
Noted on the removal of SERVERLESS_STAGE
in favor of --stage
in the declaration file. However, I also noticed the env var being renamed to BRANCH_ENV
. Was it done to make it generic-sounding and more reusable for like the docker app (beyond just the serverless lambdas)?
Just some added documentation for future readers of this PR: Another small improvement introduced by this PR is the exclusion of devDependencies
, directly reducing our packaged lambda size. Given that this PR has been tested on staging, we know that this change works fine.
also i just realised that the renaming of |
the merging of dat's PR breaks some env var changes that this PR will introduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Problem
Version 3 of the Serverless framework is out. We fix some breaking changes and upgrade our Serverless framework to v3 in this PR.
Closes #1883
Solution
Changes:
stage
Previously we injected
SERVERLESS_STAGE
(takes valuesstaging
orproduction
) intoserverless.yml
as an env variable to reuse theserverless.yml
template for launching both our staging and production lambdas. However, Serverless v3 requiresstage
to be resolved before as it is used to load and resolve.env
files e.g..env.development
,.env.production
. As advised by the team, we switch to setting this via the CLI flag--stage
.useDotEnv: true
Explicitly enabled to read environment variables, as loading .env files is kept opt-in
configValidationMode: error
Explicitly throw errors so that any misconfiguration on the file will throw an error before deployment. Severless has future plans to make this the default mode, so swapping over early can't hurt
--verbose
CLI flag
-v
option is no longer recognized](https://www.serverless.com/framework/docs/guides/upgrading-v3#cli-commands-and-options), swapped to--verbose
Tests
Deploy Notes
Post deployment, to test lambda functions in production to see if new Lambda functions are working. Also ensure that configurations are not removed (VPC and env variable settings).