Lesson Overview
Sorry to say, were almost done. We just need to clean up.
Lesson
-
Undeploy your Lambda application
-
The following command will remove all of the resources that zappa deployed into AWS including API Gateway, Lambda functions & IAM roles and triggers.
zappa undeploy dev
-
Remove your flasklambdalab-* S3 buckets
-
This script deletes the S3 buckets that we created for this lab and all of their contents. It also moves the zappa_config.json file and bucketConfig.py file to the ./backups directory ./delete_s3_buckets.py
-
-
Terminate your EC2 development instance
-
The following commands will `permanently terminate` the EC2 instance in which you run the command. Upon completion of the command, your ssh session will terminate and the EC2 instance will be gone forever
export AWS_DEFAULT_REGION=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'` curl -s http://169.254.169.254/latest/meta-data/instance-id | xargs -i aws ec2 terminate-instances --instance-ids {}
-
If you don’t want to destroy the EC2 instance, you can just shut it down instead so that it can resumed at a later time using the following command. Your account will be charged for the EBS storage volume that will remain
export AWS_DEFAULT_REGION=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'` curl -s http://169.254.169.254/latest/meta-data/instance-id | xargs -i aws ec2 stop-instances --instance-ids {}
-
Lesson Summary
In this lesson, we:
-
Removed our lambda resources that were deployed with zappa
-
Removed the S3 buckets that we created for this project
-
Deleted the EC2 instance we used for downloading & deploying code
Things to try on your own
-
Register a DNS name on [Route53](https://aws.amazon.com/route53/) for $12 and use zappa certify to register an SSL certificate.
-
Try a global deployment of your Flask/Lambda app into all AWS regions at once! Now that’s HA!
-
Use the PynamoDb library to connect you Flask application an effortlessly scalable database like DynamoDb and store more information
-
Build more lambda functions that are triggered by upload events that do things like facial recognition using AWS Rekognition
Recent Comments