|
69 | 69 | "Properties": { |
70 | 70 | "GroupDescription": "Deis SecurityGroup", |
71 | 71 | "SecurityGroupIngress": [ |
72 | | - {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0"}, |
73 | | - {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "CidrIp": "0.0.0.0/0"} |
| 72 | + { "IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0" }, |
| 73 | + { "IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "CidrIp": "0.0.0.0/0" }, |
| 74 | + { "IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "SourceSecurityGroupId": { "Fn::GetAtt": ["DeisWebELBSecurityGroup", "GroupId"] } }, |
| 75 | + { "IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "SourceSecurityGroupId": { "Fn::GetAtt": ["DeisWebELBSecurityGroup", "GroupId"] } } |
74 | 76 | ] |
75 | 77 | } |
76 | 78 | }, |
|
164 | 166 | "DesiredCapacity": {"Ref": "ClusterSize"}, |
165 | 167 | "Tags": [ |
166 | 168 | {"Key": "Name", "Value": { "Ref" : "AWS::StackName" }, "PropagateAtLaunch": true} |
| 169 | + ], |
| 170 | + "LoadBalancerNames": [ |
| 171 | + { "Ref": "DeisWebELB" } |
167 | 172 | ] |
168 | 173 | } |
169 | 174 | }, |
|
182 | 187 | } |
183 | 188 | ] |
184 | 189 | } |
| 190 | + }, |
| 191 | + "DeisWebELB": { |
| 192 | + "Type": "AWS::ElasticLoadBalancing::LoadBalancer", |
| 193 | + "Properties": { |
| 194 | + "HealthCheck": { |
| 195 | + "HealthyThreshold": "4", |
| 196 | + "Interval": "15", |
| 197 | + "Target": "HTTP:80/health-check", |
| 198 | + "Timeout": "5", |
| 199 | + "UnhealthyThreshold": "2" |
| 200 | + }, |
| 201 | + "AvailabilityZones": { "Fn::GetAZs": "" }, |
| 202 | + "Listeners": [ |
| 203 | + { |
| 204 | + "InstancePort": "80", |
| 205 | + "InstanceProtocol": "HTTP", |
| 206 | + "LoadBalancerPort": "80", |
| 207 | + "Protocol": "HTTP" |
| 208 | + }, |
| 209 | + { |
| 210 | + "InstancePort": "2222", |
| 211 | + "InstanceProtocol": "TCP", |
| 212 | + "LoadBalancerPort": "2222", |
| 213 | + "Protocol": "TCP" |
| 214 | + } |
| 215 | + ], |
| 216 | + "SecurityGroups": [ |
| 217 | + { |
| 218 | + "Fn::GetAtt": ["DeisWebELBSecurityGroup", "GroupId"] |
| 219 | + } |
| 220 | + ] |
| 221 | + } |
| 222 | + }, |
| 223 | + "DeisWebELBSecurityGroup": { |
| 224 | + "Type": "AWS::EC2::SecurityGroup", |
| 225 | + "Properties": { |
| 226 | + "GroupDescription": "Deis Web ELB SecurityGroup", |
| 227 | + "SecurityGroupIngress": [ |
| 228 | + {"IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0"}, |
| 229 | + {"IpProtocol": "tcp", "FromPort": "2222", "ToPort": "2222", "CidrIp": "0.0.0.0/0"} |
| 230 | + ] |
| 231 | + } |
185 | 232 | } |
186 | 233 | } |
187 | 234 | } |
0 commit comments