Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (58 sloc) 1.79 KB
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "make an instance, based on region, ami, subnet, and security group",
"Parameters" : {
"KeyName" : {
"Description" : "Name of and existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
},
"VpcId" : {
"Type" : "String",
"Description" : "VpcId of your existing Virtual Private Cloud (VPC)"
},
"SubnetId" : {
"Type" : "String",
"Description" : "SubnetId of an existing subnet in your Virtual Private Cloud (VPC)"
},
"AmiId" : {
"Type" : "String",
"Description" : "AMI You want to use"
},
"SecurityGroupId": {
"Type" : "String",
"Description" : "SecurityGroup to use"
}
},
"Resources" : {
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Ref" : "AmiId" },
"SecurityGroupIds" : [{ "Ref" : "SecurityGroupId" }],
"SubnetId" : { "Ref" : "SubnetId" },
"KeyName" : { "Ref" : "KeyName" },
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"#!/bin/bash -v\n",
"curl http://chef-brentozar.s3.amazonaws.com/bootstrap.sh -o /tmp/bootstrap.sh\n",
"bash /tmp/bootstrap.sh\n",
"# If all went well, signal success\n",
"cfn-signal -e $? -r 'Chef Server configuration'\n"
]]}}
}
}
},
"Outputs" : {
"InstanceId" : {
"Value" : { "Ref" : "Ec2Instance" },
"Description" : "Instance Id of newly created instance"
},
"Subnet" : {
"Value" : { "Ref" : "SubnetId" },
"Description" : "Subnet of instance"
},
"SecurityGroupId" : {
"Value" : { "Ref" : "SecurityGroupId" },
"Description" : "Security Group of instance"
}
}
}