Skip to content

Instantly share code, notes, and snippets.

@schen1628
Created August 30, 2013 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schen1628/6391959 to your computer and use it in GitHub Desktop.
Save schen1628/6391959 to your computer and use it in GitHub Desktop.
"Resources" : {
"SecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"VpcId" : { "Ref" : "VpcId" },
"GroupDescription" : { "Ref" : "GroupDesc" },
"SecurityGroupIngress" : [
{"IpProtocol" : "tcp", "FromPort" : "443", "ToPort" : "443", "CidrIp" : "0.0.0.0/0"},
{"IpProtocol" : "udp", "FromPort" : "1192", "ToPort" : "1192", "CidrIp" : "0.0.0.0/0" },
{"IpProtocol" : "tcp", "FromPort" : "943", "ToPort" : "943", "CidrIp" : { "Ref" : "AdminCidrIp"} }
]
}
},
"IPAddress" : {
"Type" : "AWS::EC2::EIP",
"Properties" : {
"Domain" : "vpc"
}
},
"Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroupIds" : [{ "Ref" : "SecurityGroup" }],
"SubnetId" : { "Ref" : "SubnetId" },
"KeyName" : { "Ref" : "KeyName" },
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"public_hostname=",
{ "Ref" : "IPAddress" },
"\n",
"admin_user=",
{ "Ref" : "AdminUser" },
"\n",
"admin_pw=",
{ "Ref" : "AdminPassword" }
]
]
}
}
},
"DependsOn" : "IPAddress"
},
"IPAssoc" : {
"Type": "AWS::EC2::EIPAssociation",
"Properties": {
"AllocationId": { "Fn::GetAtt" : [ "IPAddress", "AllocationId" ] },
"InstanceId": { "Ref" : "Instance" }
},
"DependsOn" : "Instance"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment