Creating a Basic Lambda Function to Shut Down an EC2 Instance
In this hands-on lab, we will create a basic Lambda function to shut down an EC2 instance. We will start by creating a custom IAM policy for the IAM role. We will then create a basic Lambda function using the newly created IAM policy and role along with provided Lambda function code. To verfiy that the new Lambda function shuts down our EC2 instance, we will also run a test to make sure it is all working correctly. We have provided an IAM policy and Lambda function code, which is also available in the downloads section of the course.