Utilize AWS Lambda to start/stop EC2 instances based on tags.
- Use "lambda_policy.json" to provision AWS Lambda with the appropriate permissions to start/stop EC2 instances.
- Create a "StartEC2" AWS Lambda function which utilizes "startEC2.py" to start instances.
- Create a "StopEC2" AWS Lambda function which utilizes "stopEC2.py" to stop instances.
- Create a CloudWatch rule to invoke the "StartEC2" AWS Lambda function at your desired start time.
- Create a CloudWatch rule to invoke the "StopEC2" AWS Lambda function at your desired stop time.
- Tag instances with AutoStart: True and AutoStop: True to associate them with the AWS Lambda functions.
Instances tagged with AutoStart: True and AutoStop: True will now start and stop at the times specified in the CloudWatch rules.