Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 543e4bab0f
Fetching contributors…

Cannot retrieve contributors at this time

133 lines (132 sloc) 4.011 kb
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Engulf Workers",
"Parameters" : {
"MasterInstanceType" : {
"Description" : "Master EC2 instance type",
"Type" : "String",
"Default" : "m1.small",
"AllowedValues" : [ "m1.small","m1.medium","m1.large","m1.xlarge","m2.xlarge","m2.2xlarge","m2.4xlarge","c1.medium","c1.xlarge","cc1.4xlarge","cc2.8xlarge","cg1.4xlarge"],
"ConstraintDescription" : "must be a valid EC2 instance type."
},
"WorkerInstanceType" : {
"Description" : "Worker(s) EC2 instance type",
"Type" : "String",
"Default" : "c1.medium",
"AllowedValues" : [ "m1.small","m1.medium","m1.large","m1.xlarge","m2.xlarge","m2.2xlarge","m2.4xlarge","c1.medium","c1.xlarge","cc1.4xlarge","cc2.8xlarge","cg1.4xlarge"],
"ConstraintDescription" : "must be a valid EC2 instance type."
},
"WorkerInstanceCount" : {
"Description" : "Number of worker instances to start",
"Type" : "String",
"Default" : "1"
}
},
"Resources": {
"engulfMaster": {
"Type": "AWS::EC2::Instance",
"Properties": {
"DisableApiTermination": "FALSE",
"ImageId": "ami-5f2a9f36",
"InstanceType": {"Ref": "MasterInstanceType"},
"KernelId": "aki-825ea7eb",
"Monitoring": "false",
"UserData": {"Fn::Base64": "--mode master"},
"SecurityGroups": [{"Ref": "sgdefault"}]
}
},
"WorkerGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : {"Fn::GetAZs" : ""},
"LaunchConfigurationName" : { "Ref" : "WorkerLaunchConfiguration" },
"MinSize" : { "Ref" : "WorkerInstanceCount" },
"MaxSize" : { "Ref" : "WorkerInstanceCount" },
"DesiredCapacity" : { "Ref" : "WorkerInstanceCount" }
}
},
"WorkerLaunchConfiguration": {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties":{
"ImageId": "ami-5f2a9f36",
"InstanceType": {"Ref": "WorkerInstanceType"},
"SecurityGroups": [{"Ref": "sgdefault"}],
"KernelId": "aki-825ea7eb",
"UserData": {"Fn::Base64":
{"Fn::Join":
["",
["--mode worker --connect-to ",
{"Fn::GetAtt": ["engulfMaster", "PrivateIp"]}, ":4025"]]}}
}
},
"sgdefault": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "default group",
"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"
}
]
}
},
"ingress1": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupName": {
"Ref": "sgdefault"
},
"IpProtocol": "tcp",
"FromPort": "0",
"ToPort": "65535",
"SourceSecurityGroupName": {
"Ref": "sgdefault"
}
}
},
"ingress2": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupName": {
"Ref": "sgdefault"
},
"IpProtocol": "udp",
"FromPort": "0",
"ToPort": "65535",
"SourceSecurityGroupName": {
"Ref": "sgdefault"
}
}
},
"ingress3": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupName": {
"Ref": "sgdefault"
},
"IpProtocol": "icmp",
"FromPort": "-1",
"ToPort": "-1",
"SourceSecurityGroupName": {
"Ref": "sgdefault"
}
}
}
},
"Outputs": {
"URL": {
"Value": {
"Fn::Join": ["", ["http://", {"Fn::GetAtt": ["engulfMaster", "PublicIp"]}, ":8080"]]
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.