Updating and removing

The Serverless Framework also provides the ability to update resources automatically if you call sls deploy again. We can add this as a function to the deployment bash script:

update() {
sls deploy
}

This command is useful if you want to update the code of some of the lambdas, but don't want to leave the session maintained by Cognito.

To remove everything we deployed, we can use the following function:

remove() {
echo "ASSETS REMOVING"
sls client remove
echo "LAMBDAS REMOVING"
sls remove
echo "ASSETS CLEANUP"
rm -rf assets
mkdir assets
touch assets/.gitkeep
}

It works because the Serverless Framework supports removing declared resources. I recommend you clean up everything after experimenting, because AWS will produce bills for services even if you don't use this demo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.216