Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tkluu10/StartStopEC2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Start/Stop EC2 with AWS Lambda

Utilize AWS Lambda to start/stop EC2 instances based on tags.

Instructions

  1. Use "lambda_policy.json" to provision AWS Lambda with the appropriate permissions to start/stop EC2 instances.
  2. Create a "StartEC2" AWS Lambda function which utilizes "startEC2.py" to start instances.
  3. Create a "StopEC2" AWS Lambda function which utilizes "stopEC2.py" to stop instances.
  4. Create a CloudWatch rule to invoke the "StartEC2" AWS Lambda function at your desired start time.
  5. Create a CloudWatch rule to invoke the "StopEC2" AWS Lambda function at your desired stop time.
  6. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages