Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
thomasmichaelwallace / lambda_function.py
Last active September 8, 2022 12:55
Lambda function to launch an ec2-instance
""" Lambda to launch ec2-instances """
import boto3
REGION = 'eu-central-1' # region to launch instance.
AMI = 'ami-24bd1b4b'
# matching region/setup amazon linux ami, as per:
# https://aws.amazon.com/amazon-linux-ami/
INSTANCE_TYPE = 'm3.medium' # instance type to launch.
EC2 = boto3.client('ec2', region_name=REGION)