Skip to content

Instantly share code, notes, and snippets.

@dstrctrng
Created September 3, 2013 22:37
Show Gist options
  • Save dstrctrng/6430551 to your computer and use it in GitHub Desktop.
Save dstrctrng/6430551 to your computer and use it in GitHub Desktop.
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"KeyName" : { "Ref" : "KeyName" },
"SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["",[
"#!/bin/bash -ex","\n",
"yum -y install gcc-c++ make","\n",
"yum -y install mysql-devel sqlite-devel","\n",
"yum -y install ruby-rdoc rubygems ruby-mysql ruby-devel","\n",
"gem install --no-ri --no-rdoc rails","\n",
"gem install --no-ri --no-rdoc mysql","\n",
"gem install --no-ri --no-rdoc sqlite3","\n",
"rails new myapp","\n",
"cd myapp","\n",
"rails server -d","\n",
"curl -X PUT -H 'Content-Type:' --data-binary '{\"Status\" : \"SUCCESS\",",
"\"Reason\" : \"The application myapp is ready\",",
"\"UniqueId\" : \"myapp\",",
"\"Data\" : \"Done\"}' ",
"\"", {"Ref" : "WaitForInstanceWaitHandle"},"\"\n" ]]}}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment