Skip to content

Instantly share code, notes, and snippets.

@zathomas
Created June 7, 2012 12:47
Show Gist options
  • Select an option

  • Save zathomas/2888642 to your computer and use it in GitHub Desktop.

Select an option

Save zathomas/2888642 to your computer and use it in GitHub Desktop.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Create a standalone OAE server which provisions itself using git and puppet.",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "String"
},
"AlertEmail": {
"Description": "email address to notify of operational issues",
"Type": "String"
}
},
"Mappings": {
"RegionMap": {
"us-east-1": {
"AMI": "ami-e565ba8c"
},
"us-west-1": {
"AMI": "ami-655a0a20"
},
"eu-west-1": {
"AMI": "ami-7fd4e10b"
},
"ap-southeast-1": {
"AMI": "ami-72621c20"
},
"ap-northeast-1": {
"AMI": "ami-8e08a38f"
}
}
},
"Resources": {
"AlarmTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"Subscription": [{
"Protocol": "email",
"Endpoint": {
"Ref": "AlertEmail"
}
}]
}
},
"Ec2Instance1": {
"Type": "AWS::EC2::Instance",
"Properties": {
"SecurityGroups": [{
"Ref": "InstanceSecurityGroup"
}],
"KeyName": {
"Ref": "KeyName"
},
"ImageId": {
"Fn::FindInMap": ["RegionMap", {
"Ref": "AWS::Region"
},
"AMI"]
},
"UserData": {
"Fn::Base64": {
"Fn::Join": ["", [
"#!/bin/bash -ex", "\n",
"exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1", "\n",
"yum -y install git puppet", "\n",
"git clone git://github.com/zathomas/puppet-oae-example.git", "\n",
"cd puppet-oae-example", "\n",
"./bin/pull.sh", "\n",
"./bin/apply.sh --environment standalone-demo --verbose --certname oae-standalone.localdomain", "\n"]]
}
}
}
},
"InstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Enable SSH, NFS, and HTTP access on the inbound port",
"SecurityGroupIngress": [{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "8080",
"ToPort": "8080",
"CidrIp": "0.0.0.0/0"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment