Skip to content

Instantly share code, notes, and snippets.

View deugouegithub2020's full-sized avatar

deugouegithub2020

View GitHub Profile
import json
import boto3
region = 'us-east-2'
ec2 = boto3.client('ec2', region_name=region)
def lambda_handler(event, context):
instances = event["instances"].split(',')
action = event["action"]
@deugouegithub2020
deugouegithub2020 / amazon-linux-userdata.json
Created September 3, 2021 15:35 — forked from eMahtab/amazon-linux-userdata.json
Complete Cloudformation template for Installing Apache web server on Amazon Linux with UserData
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template VPC_with_PublicIPs_And_DNS: Sample template that creates a VPC with DNS and public IPs enabled. Note that you are billed for the AWS resources that you use when you create a stack from this template.",
"Parameters": {
"KeyPair": {
"Description": "Name of the keypair to use for SSH access",
"Type": "String"
}
},