This lab walks you through shutting down and terminating EC2 instances using AWS Lambda. In this lab, we will create a sample lambda function. This lambda function when triggered will shut down and terminate an EC2 Instance.
Duration: 30 minutes
AWS Region: US East (N. Virginia) us-east-1
Log into the AWS Management Console.
Create two EC2 instances.
Create an IAM Role.
Create a lambda function.
Configure a test event.
Performing stop and terminate actions on EC2 Instances
Check the EC2 instance’s status
Performing stop and terminate action again
Check the EC2 instance’s status again
Validation of the lab