Skip to content

Instantly share code, notes, and snippets.

@maraca
Created March 6, 2014 20:13
Show Gist options
  • Save maraca/9398453 to your computer and use it in GitHub Desktop.
Save maraca/9398453 to your computer and use it in GitHub Desktop.
Cloudformation template for our hello-world Packer AMI
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Creates an EC2 instance with our hello-world AMI",
"Parameters" : {
"KeyName" : {
"Description" : "Name of the production EC2 KeyPair to enable SSH to the instance",
"Type" : "String"
},
"InstanceImageId" : {
"Description" : "EC2 image id (e.g. 'ami-d9d6a6b0')",
"Type" : "String"
}
},
"Resources" : {
"Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Ref" : "InstanceImageId" },
"InstanceType" : "m1.small",
"KeyName" : { "Ref" : "KeyName" },
"SecurityGroups": [ { "Ref": "InstanceSecurityGroup" } ],
"Tags" : [
{"Key" : "Name", "Value" : "HelloWorld" }
]
}
},
"InstanceSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Open all (most) ports.",
"SecurityGroupIngress" : [
{ "IpProtocol" : "tcp",
"FromPort" : "0",
"ToPort" : "65000",
"CidrIp" : "0.0.0.0/0"
},
{ "IpProtocol" : "udp",
"FromPort" : "0",
"ToPort" : "65000",
"CidrIp" : "0.0.0.0/0"
}
]
}
}
},
"Outputs" : {
"InstanceId" : {
"Description" : "InstanceId of the newly created EC2 instance",
"Value" : { "Ref" : "Instance" }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment