cloudformation counter demo

This commit is contained in:
Sebastian Rieger 2018-06-18 23:14:07 +02:00
parent 8b5c04dd8a
commit f59580905e
4 changed files with 934 additions and 663 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

View File

@ -1,7 +1,6 @@
{ {
"AWSTemplateFormatVersion": "2010-09-09", "AWSTemplateFormatVersion": "2010-09-09",
"Parameters": "Parameters": {
{
"paramImageID": { "paramImageID": {
"Type": "AWS::EC2::Image::Id", "Type": "AWS::EC2::Image::Id",
"Default": "ami-f573e19a", "Default": "ami-f573e19a",
@ -10,7 +9,11 @@
"paramInstanceType": { "paramInstanceType": {
"Type": "String", "Type": "String",
"Default": "t2.nano", "Default": "t2.nano",
"AllowedValues" : ["t2.nano", "t2.micro", "m1.small"], "AllowedValues": [
"t2.nano",
"t2.micro",
"m1.small"
],
"Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro." "Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
}, },
"paramKeyPair": { "paramKeyPair": {
@ -28,11 +31,23 @@
"Type": "AWS::AutoScaling::LaunchConfiguration", "Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": { "Properties": {
"AssociatePublicIpAddress": true, "AssociatePublicIpAddress": true,
"ImageId": { "Ref" : "paramImageID" }, "ImageId": {
"InstanceType": { "Ref" : "paramInstanceType" }, "Ref": "paramImageID"
"KeyName": { "Ref" : "paramKeyPair" }, },
"IamInstanceProfile": { "Ref" : "paramIamInstanceRole" }, "InstanceType": {
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ], "Ref": "paramInstanceType"
},
"KeyName": {
"Ref": "paramKeyPair"
},
"IamInstanceProfile": {
"Ref": "paramIamInstanceRole"
},
"SecurityGroups": [
{
"Ref": "sgCloudCompDemoSecurityGroup"
}
],
"UserData": { "UserData": {
"Fn::Base64": { "Fn::Base64": {
"Fn::Join": [ "Fn::Join": [
@ -121,81 +136,150 @@
"CidrBlock": "10.0.0.0/16", "CidrBlock": "10.0.0.0/16",
"EnableDnsSupport": "true", "EnableDnsSupport": "true",
"EnableDnsHostnames": "true", "EnableDnsHostnames": "true",
"Tags" : [ {"Key" : "Name", "Value" : "vpcCloudCompCounterDemo"} ] "Tags": [
{
"Key": "Name",
"Value": "vpcCloudCompCounterDemo"
}
]
} }
}, },
"subnetCloudCompCounterDemoPublicSubnetAz1": { "subnetCloudCompCounterDemoPublicSubnetAz1": {
"Type": "AWS::EC2::Subnet", "Type": "AWS::EC2::Subnet",
"Properties": { "Properties": {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" }, "VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"CidrBlock": "10.0.0.0/24", "CidrBlock": "10.0.0.0/24",
"AvailabilityZone" : { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, "AvailabilityZone": {
"Tags" : [ {"Key" : "Name", "Value" : "subnetCloudCompCounterDemoPublicSubnetAz1"} ] "Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
"Tags": [
{
"Key": "Name",
"Value": "subnetCloudCompCounterDemoPublicSubnetAz1"
}
]
} }
}, },
"subnetCloudCompCounterDemoPublicSubnetAz2": { "subnetCloudCompCounterDemoPublicSubnetAz2": {
"Type": "AWS::EC2::Subnet", "Type": "AWS::EC2::Subnet",
"Properties": { "Properties": {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" }, "VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"CidrBlock": "10.0.1.0/24", "CidrBlock": "10.0.1.0/24",
"AvailabilityZone" : { "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, "AvailabilityZone": {
"Tags" : [ {"Key" : "Name", "Value" : "subnetCloudCompCounterDemoPublicSubnetAz2"} ] "Fn::Select": [
"1",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
"Tags": [
{
"Key": "Name",
"Value": "subnetCloudCompCounterDemoPublicSubnetAz2"
}
]
} }
}, },
"igCloudCompCounterDemo": { "igCloudCompCounterDemo": {
"Type": "AWS::EC2::InternetGateway", "Type": "AWS::EC2::InternetGateway",
"Properties": { "Properties": {
"Tags" : [ {"Key" : "Name", "Value" : "igCloudCompCounterDemo"} ] "Tags": [
{
"Key": "Name",
"Value": "igCloudCompCounterDemo"
}
]
} }
}, },
"attachGateway": { "attachGateway": {
"Type": "AWS::EC2::VPCGatewayAttachment", "Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": { "Properties": {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" }, "VpcId": {
"InternetGatewayId": { "Ref" : "igCloudCompCounterDemo" } "Ref": "vpcCloudCompCounterDemo"
},
"InternetGatewayId": {
"Ref": "igCloudCompCounterDemo"
}
} }
}, },
"routetableViaIgw": { "routetableViaIgw": {
"Type": "AWS::EC2::RouteTable", "Type": "AWS::EC2::RouteTable",
"Properties": { "Properties": {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" }, "VpcId": {
"Tags" : [ {"Key" : "Name", "Value" : "routetableViaIgw"} ] "Ref": "vpcCloudCompCounterDemo"
},
"Tags": [
{
"Key": "Name",
"Value": "routetableViaIgw"
}
]
} }
}, },
"publicrouteViaIgw": { "publicrouteViaIgw": {
"Type": "AWS::EC2::Route", "Type": "AWS::EC2::Route",
"DependsOn": "attachGateway", "DependsOn": "attachGateway",
"Properties": { "Properties": {
"RouteTableId": { "Ref" : "routetableViaIgw" }, "RouteTableId": {
"Ref": "routetableViaIgw"
},
"DestinationCidrBlock": "0.0.0.0/0", "DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": { "Ref" : "igCloudCompCounterDemo" } "GatewayId": {
"Ref": "igCloudCompCounterDemo"
}
} }
}, },
"publicsubnet1RouteTableAssociation": { "publicsubnet1RouteTableAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation", "Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": { "Properties": {
"SubnetId": { "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz1" }, "SubnetId": {
"RouteTableId": { "Ref" : "routetableViaIgw" } "Ref": "subnetCloudCompCounterDemoPublicSubnetAz1"
},
"RouteTableId": {
"Ref": "routetableViaIgw"
}
} }
}, },
"publicsubnet1RouteTableAssociation": { "publicsubnet2RouteTableAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation", "Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": { "Properties": {
"SubnetId": { "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz2" }, "SubnetId": {
"RouteTableId": { "Ref" : "routetableViaIgw" } "Ref": "subnetCloudCompCounterDemoPublicSubnetAz2"
},
"RouteTableId": {
"Ref": "routetableViaIgw"
}
} }
}, },
"sgCloudCompDemoSecurityGroup": { "sgCloudCompDemoSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup", "Type": "AWS::EC2::SecurityGroup",
"Properties": { "Properties": {
"GroupDescription": "CloudComp Counter Demo", "GroupDescription": "CloudComp Counter Demo",
"VpcId": { "Ref": "vpcCloudCompCounterDemo" } "VpcId": {
"Ref": "vpcCloudCompCounterDemo"
}
} }
}, },
"ingress1": { "ingress1": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "tcp", "IpProtocol": "tcp",
"FromPort": "36037", "FromPort": "36037",
"ToPort": "36137", "ToPort": "36137",
@ -205,7 +289,9 @@
"ingress2": { "ingress2": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "tcp", "IpProtocol": "tcp",
"FromPort": "22", "FromPort": "22",
"ToPort": "22", "ToPort": "22",
@ -215,7 +301,9 @@
"ingress3": { "ingress3": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "udp", "IpProtocol": "udp",
"FromPort": "36037", "FromPort": "36037",
"ToPort": "36137", "ToPort": "36137",
@ -225,7 +313,9 @@
"egress1": { "egress1": {
"Type": "AWS::EC2::SecurityGroupEgress", "Type": "AWS::EC2::SecurityGroupEgress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "-1", "IpProtocol": "-1",
"CidrIp": "0.0.0.0/0" "CidrIp": "0.0.0.0/0"
} }
@ -234,10 +324,32 @@
"Type": "AWS::AutoScaling::AutoScalingGroup", "Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": { "Properties": {
"AvailabilityZones": [ "AvailabilityZones": [
{ "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, {
{ "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] } "Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
{
"Fn::Select": [
"1",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
}
],
"TargetGroupARNs": [
{
"Ref": "elbCloudCompTargetGroup"
}
], ],
"TargetGroupARNs": [ { "Ref": "elbCloudCompTargetGroup" } ],
"Cooldown": "30", "Cooldown": "30",
"DesiredCapacity": "1", "DesiredCapacity": "1",
"HealthCheckGracePeriod": "60", "HealthCheckGracePeriod": "60",
@ -245,8 +357,12 @@
"MaxSize": "3", "MaxSize": "3",
"MinSize": "1", "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz1" }, {
{ "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz2" } "Ref": "subnetCloudCompCounterDemoPublicSubnetAz1"
},
{
"Ref": "subnetCloudCompCounterDemoPublicSubnetAz2"
}
], ],
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "lcVertSysAutoScaleConfigv11" "Ref": "lcVertSysAutoScaleConfigv11"
@ -266,7 +382,9 @@
] ]
} }
], ],
"TerminationPolicies": [ "Default" ] "TerminationPolicies": [
"Default"
]
} }
}, },
"sgCloudCompScalePolicy": { "sgCloudCompScalePolicy": {
@ -280,9 +398,38 @@
"TargetValue": 5, "TargetValue": 5,
"PredefinedMetricSpecification": { "PredefinedMetricSpecification": {
"PredefinedMetricType": "ALBRequestCountPerTarget", "PredefinedMetricType": "ALBRequestCountPerTarget",
"ResourceLabel": { "Fn::Join": [ "/", [ "ResourceLabel": {
"app/elbCloudCompLoadBalancer", { "Fn::Select": [ "3", { "Fn::Split": [ "/", { "Ref": "elbCloudCompLoadBalancer" } ] } ] }, "Fn::Join": [
"targetgroup/elbCloudCompTargetGroup", { "Fn::Select": [ "2", { "Fn::Split": [ "/", { "Ref": "elbCloudCompTargetGroup" } ] } ] } "/",
[
"app/elbCloudCompLoadBalancer",
{
"Fn::Select": [
"3",
{
"Fn::Split": [
"/",
{
"Ref": "elbCloudCompLoadBalancer"
}
]
}
]
},
"targetgroup/elbCloudCompTargetGroup",
{
"Fn::Select": [
"2",
{
"Fn::Split": [
"/",
{
"Ref": "elbCloudCompTargetGroup"
}
]
}
]
}
] ]
] ]
} }
@ -300,10 +447,18 @@
"IpAddressType": "ipv4", "IpAddressType": "ipv4",
"Type": "application", "Type": "application",
"Scheme": "internet-facing", "Scheme": "internet-facing",
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ], "SecurityGroups": [
{
"Ref": "sgCloudCompDemoSecurityGroup"
}
],
"Subnets": [ "Subnets": [
{ "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz1" }, {
{ "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz2" } "Ref": "subnetCloudCompCounterDemoPublicSubnetAz1"
},
{
"Ref": "subnetCloudCompCounterDemoPublicSubnetAz2"
}
] ]
} }
}, },
@ -329,7 +484,9 @@
"HttpCode": "200" "HttpCode": "200"
}, },
"Name": "elbCloudCompTargetGroup", "Name": "elbCloudCompTargetGroup",
"VpcId": { "Ref": "vpcCloudCompCounterDemo" } "VpcId": {
"Ref": "vpcCloudCompCounterDemo"
}
} }
}, },
"elbCloudCompListener": { "elbCloudCompListener": {
@ -343,25 +500,46 @@
"DefaultActions": [ "DefaultActions": [
{ {
"Type": "forward", "Type": "forward",
"TargetGroupArn": { "Ref": "elbCloudCompTargetGroup" } "TargetGroupArn": {
"Ref": "elbCloudCompTargetGroup"
}
} }
] ]
} }
} }
}, },
"Outputs": "Outputs": {
{
"LoadBalancer": { "LoadBalancer": {
"Description": "Load Balancer", "Description": "Load Balancer",
"Value": { "Ref" : "elbCloudCompLoadBalancer" } "Value": {
"Ref": "elbCloudCompLoadBalancer"
}
}, },
"LoadBalancerDns": { "LoadBalancerDns": {
"Description": "Load Balancer DNS", "Description": "Load Balancer DNS",
"Value": { "Fn::GetAtt" : ["elbCloudCompLoadBalancer", "DNSName"] } "Value": {
"Fn::GetAtt": [
"elbCloudCompLoadBalancer",
"DNSName"
]
}
}, },
"LoadBalancerURL": { "LoadBalancerURL": {
"Description": "Load Balancer URL", "Description": "Load Balancer URL",
"Value": { "Fn::Join": [ ":", [ { "Fn::GetAtt" : ["elbCloudCompLoadBalancer", "DNSName"] }, "36042/counter" ] ] } "Value": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"elbCloudCompLoadBalancer",
"DNSName"
]
},
"36042/counter"
]
]
}
} }
}, },
"Description": "CloudComp Counter Demo" "Description": "CloudComp Counter Demo"

View File

@ -1,7 +1,6 @@
{ {
"AWSTemplateFormatVersion": "2010-09-09", "AWSTemplateFormatVersion": "2010-09-09",
"Parameters": "Parameters": {
{
"paramImageID": { "paramImageID": {
"Type": "AWS::EC2::Image::Id", "Type": "AWS::EC2::Image::Id",
"Default": "ami-f573e19a", "Default": "ami-f573e19a",
@ -10,7 +9,11 @@
"paramInstanceType": { "paramInstanceType": {
"Type": "String", "Type": "String",
"Default": "t2.nano", "Default": "t2.nano",
"AllowedValues" : ["t2.nano", "t2.micro", "m1.small"], "AllowedValues": [
"t2.nano",
"t2.micro",
"m1.small"
],
"Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro." "Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
}, },
"paramKeyPair": { "paramKeyPair": {
@ -40,11 +43,23 @@
"Type": "AWS::AutoScaling::LaunchConfiguration", "Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": { "Properties": {
"AssociatePublicIpAddress": true, "AssociatePublicIpAddress": true,
"ImageId": { "Ref" : "paramImageID" }, "ImageId": {
"InstanceType": { "Ref" : "paramInstanceType" }, "Ref": "paramImageID"
"KeyName": { "Ref" : "paramKeyPair" }, },
"IamInstanceProfile": { "Ref" : "paramIamInstanceRole" }, "InstanceType": {
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ], "Ref": "paramInstanceType"
},
"KeyName": {
"Ref": "paramKeyPair"
},
"IamInstanceProfile": {
"Ref": "paramIamInstanceRole"
},
"SecurityGroups": [
{
"Ref": "sgCloudCompDemoSecurityGroup"
}
],
"UserData": { "UserData": {
"Fn::Base64": { "Fn::Base64": {
"Fn::Join": [ "Fn::Join": [
@ -131,13 +146,17 @@
"Type": "AWS::EC2::SecurityGroup", "Type": "AWS::EC2::SecurityGroup",
"Properties": { "Properties": {
"GroupDescription": "CloudComp Counter Demo", "GroupDescription": "CloudComp Counter Demo",
"VpcId": { "Ref": "paramVPC" } "VpcId": {
"Ref": "paramVPC"
}
} }
}, },
"ingress1": { "ingress1": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "tcp", "IpProtocol": "tcp",
"FromPort": "36037", "FromPort": "36037",
"ToPort": "36137", "ToPort": "36137",
@ -147,7 +166,9 @@
"ingress2": { "ingress2": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "tcp", "IpProtocol": "tcp",
"FromPort": "22", "FromPort": "22",
"ToPort": "22", "ToPort": "22",
@ -157,7 +178,9 @@
"ingress3": { "ingress3": {
"Type": "AWS::EC2::SecurityGroupIngress", "Type": "AWS::EC2::SecurityGroupIngress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "udp", "IpProtocol": "udp",
"FromPort": "36037", "FromPort": "36037",
"ToPort": "36137", "ToPort": "36137",
@ -167,7 +190,9 @@
"egress1": { "egress1": {
"Type": "AWS::EC2::SecurityGroupEgress", "Type": "AWS::EC2::SecurityGroupEgress",
"Properties": { "Properties": {
"GroupId": { "Ref": "sgCloudCompDemoSecurityGroup" }, "GroupId": {
"Ref": "sgCloudCompDemoSecurityGroup"
},
"IpProtocol": "-1", "IpProtocol": "-1",
"CidrIp": "0.0.0.0/0" "CidrIp": "0.0.0.0/0"
} }
@ -175,15 +200,23 @@
"asgCloudCompAutoScaleGroup": { "asgCloudCompAutoScaleGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup", "Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": { "Properties": {
"AvailabilityZones": { "Ref" : "paramAvailabilityZones" }, "AvailabilityZones": {
"TargetGroupARNs": [ { "Ref": "elbCloudCompTargetGroup" } ], "Ref": "paramAvailabilityZones"
},
"TargetGroupARNs": [
{
"Ref": "elbCloudCompTargetGroup"
}
],
"Cooldown": "30", "Cooldown": "30",
"DesiredCapacity": "1", "DesiredCapacity": "1",
"HealthCheckGracePeriod": "60", "HealthCheckGracePeriod": "60",
"HealthCheckType": "EC2", "HealthCheckType": "EC2",
"MaxSize": "3", "MaxSize": "3",
"MinSize": "1", "MinSize": "1",
"VPCZoneIdentifier": { "Ref": "paramSubnetIDs" }, "VPCZoneIdentifier": {
"Ref": "paramSubnetIDs"
},
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "lcVertSysAutoScaleConfigv11" "Ref": "lcVertSysAutoScaleConfigv11"
}, },
@ -202,7 +235,9 @@
] ]
} }
], ],
"TerminationPolicies": [ "Default" ] "TerminationPolicies": [
"Default"
]
} }
}, },
"sgCloudCompScalePolicy": { "sgCloudCompScalePolicy": {
@ -216,9 +251,38 @@
"TargetValue": 5, "TargetValue": 5,
"PredefinedMetricSpecification": { "PredefinedMetricSpecification": {
"PredefinedMetricType": "ALBRequestCountPerTarget", "PredefinedMetricType": "ALBRequestCountPerTarget",
"ResourceLabel": { "Fn::Join": [ "/", [ "ResourceLabel": {
"app/elbCloudCompLoadBalancer", { "Fn::Select": [ "3", { "Fn::Split": [ "/", { "Ref": "elbCloudCompLoadBalancer" } ] } ] }, "Fn::Join": [
"targetgroup/elbCloudCompTargetGroup", { "Fn::Select": [ "2", { "Fn::Split": [ "/", { "Ref": "elbCloudCompTargetGroup" } ] } ] } "/",
[
"app/elbCloudCompLoadBalancer",
{
"Fn::Select": [
"3",
{
"Fn::Split": [
"/",
{
"Ref": "elbCloudCompLoadBalancer"
}
]
}
]
},
"targetgroup/elbCloudCompTargetGroup",
{
"Fn::Select": [
"2",
{
"Fn::Split": [
"/",
{
"Ref": "elbCloudCompTargetGroup"
}
]
}
]
}
] ]
] ]
} }
@ -236,8 +300,14 @@
"IpAddressType": "ipv4", "IpAddressType": "ipv4",
"Type": "application", "Type": "application",
"Scheme": "internet-facing", "Scheme": "internet-facing",
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ], "SecurityGroups": [
"Subnets": { "Ref": "paramSubnetIDs" } {
"Ref": "sgCloudCompDemoSecurityGroup"
}
],
"Subnets": {
"Ref": "paramSubnetIDs"
}
} }
}, },
"elbCloudCompTargetGroup": { "elbCloudCompTargetGroup": {
@ -262,7 +332,9 @@
"HttpCode": "200" "HttpCode": "200"
}, },
"Name": "elbCloudCompTargetGroup", "Name": "elbCloudCompTargetGroup",
"VpcId": { "Ref": "paramVPC" } "VpcId": {
"Ref": "paramVPC"
}
} }
}, },
"elbCloudCompListener": { "elbCloudCompListener": {
@ -276,25 +348,46 @@
"DefaultActions": [ "DefaultActions": [
{ {
"Type": "forward", "Type": "forward",
"TargetGroupArn": { "Ref": "elbCloudCompTargetGroup" } "TargetGroupArn": {
"Ref": "elbCloudCompTargetGroup"
}
} }
] ]
} }
} }
}, },
"Outputs": "Outputs": {
{
"LoadBalancer": { "LoadBalancer": {
"Description": "Load Balancer", "Description": "Load Balancer",
"Value": { "Ref" : "elbCloudCompLoadBalancer" } "Value": {
"Ref": "elbCloudCompLoadBalancer"
}
}, },
"LoadBalancerDns": { "LoadBalancerDns": {
"Description": "Load Balancer DNS", "Description": "Load Balancer DNS",
"Value": { "Fn::GetAtt" : ["elbCloudCompLoadBalancer", "DNSName"] } "Value": {
"Fn::GetAtt": [
"elbCloudCompLoadBalancer",
"DNSName"
]
}
}, },
"LoadBalancerURL": { "LoadBalancerURL": {
"Description": "Load Balancer URL", "Description": "Load Balancer URL",
"Value": { "Fn::Join": [ ":", [ { "Fn::GetAtt" : ["elbCloudCompLoadBalancer", "DNSName"] }, "36042/counter" ] ] } "Value": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"elbCloudCompLoadBalancer",
"DNSName"
]
},
"36042/counter"
]
]
}
} }
}, },
"Description": "CloudComp Counter Demo" "Description": "CloudComp Counter Demo"