Files
dsk-iac/terraform/lambda/dsk-agent-ec2/lambda_function/dsk-agent-ec2-start.py
2024-01-29 14:20:01 +09:00

8 lines
254 B
Python

import boto3
region = 'ap-northeast-2'
instances = ['i-0b8d61b56a3baf918']
ec2 = boto3.client('ec2', region_name=region)
def lambda_handler(event, context):
ec2.start_instances(InstanceIds=instances)
print('Started instances: ' + str(instances))