Home » serverless
motor engine

Automatic EC2 Start/Stop with AWS Lambda and Event Bridge

Step 1: Create the Lambda Function This function will start or stop your EC2 instances based on the time. 3. Add Code to the Lambda Function: Multi Copy Code Blocks python Copy Code import boto3 def lambda_handler(event, context): ec2 = boto3.client(‘ec2′, region_name=’ap-south-1’) #Replace your aws region instances = [‘i-xxxxxxxxxxxxx’] #replace your instance id action =…

Read More