Task 6 Stop An Ec2 Instance Using Aws Lambda Function Tags
Task 6 Stop An Ec2 Instance Using Aws Lambda Function Tags
1. In the Code section of your Lambda function, delete the sample code.
2. Paste the following Python code:
3. Click Deploy.
1. Go to EC2 → Instances.
2. Select the instance you want to stop automatically.
3. Click Tags → Manage Tags → Add Tag.
4. Key: AutoStop
5. Value: True
6. Click Save.