This blog post will be taking you through the details to build Serverless WebApp - Use Case 2 which will get the running EC2 instances with tag AutoOff=yes through lambda function and stop those instances, display the details in webpage and add to cloudwatch logs.
Cleanup
Network Diagram
Output Webpage
Steps to AutoOff EC2
- Copy StopRunningInstances.py code to replace existing Lambda Function
- Add `AmazonEC2FullAccess` LambdaExecutionRole created earlier
- Create one or more EC2 instances with tag name `AutoOff` with the value `yes` (case sensitive)
- Launch the S3 Static Website URL to test the running EC2 instances with the tag AutoOff=yes are shutdown.
No comments:
Post a Comment