- Install and setup
serverless. - Install deps (run
yarn). - Create
.envfile. (required configs:PRODUCTION_URL_APP,MONGO_URL_TEST,MONGO_URL,Amazon_accessKeyId,Amazon_secretAccessKey,EMAIL_SUPPORT_FROM_ADDRESS) - Also you can create
.env.productionfile for production deploy.
- Development deploy: Run
sls deploy - Production deploy: Run
NODE_ENV=production sls deploy - If files did not change: Add
--force - Deploy particular function:
NODE_ENV=production sls deploy function --function checkUserInactivity --force - invoke locally weeklyStat, only staging MongoDB:
sls invoke local -f weeklyStat -e ONLY_MONGO_URL=1
- For invoking
checkCardExpirationlocally runsls invoke local -l -f checkCardExpiration. - For invoking
checkCardExpirationrunsls invoke -l -f checkCardExpiration.
If stack inside Cloudformation is in UPDATE_ROLLBACK_FAILED state, it will not recover. You have to delete all associated resources (most likely, lambda functions and S3 buckets), then delete stack, then deploy all lambda functions with NODE_ENV=production sls deploy. AWS Cloudformation will create a new stack.
ln -s /home/timur101/apps/async/private-api /home/timur101/apps/async/lambda/src
Syntax for command:
ln -s /shortcut-to-folder /location-of-shortcut
https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serving-outdated-content-s3/
- CloudFront for static files
- deploy SSR React app to Lambda@Edge