AWS - Scheduled shutdown and startup of the EC2 instances without AWS Instance Scheduler

preview_player
Показать описание
I have found this simple method to schedule the start and stop of an AWS instance or a group of instances. This is simpler than using the CloudFormation Schuler template and this takes only 5 minutes to set up.

Chapters
---------------
0:00 - Scheduled shutdown and startup of the EC2 instances
0:05 - Create IAM Policy
1:33 - Create IAM Role
2:15 - Create Lambda function
2:21 - Lambda ec2 Stop Function
4:45 - Lambda ec2 Start Function
6:23 - Setup CloudWatch rule
9:30 - Subscribe to the channel

#aws #scheduledec2shutdown #ec2schedule #ec2stopstart
Рекомендации по теме
Комментарии
Автор

if we want to run this function on multiple instances at single time how do I do that Please explain.

harrichavan
Автор

I got an error: parsing error identifier directly after number

const ec2 = new AWS.EC2({ region: event.instanceRegion });
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise()

I replaced instanceRegion = Availability Zone
instanceId = Instance ID

yassermamdouhymm
Автор

Does lamba charges for using stop start function?

balkrushna