Terraform - Lambda - agent ec2 stop 추가
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
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))
|
||||
Reference in New Issue
Block a user