Browse Source

cloudformation counter demo

pull/3/head
Sebastian Rieger 7 years ago
parent
commit
f59580905e
  1. BIN
      aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc-designer (1).png
  2. BIN
      aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc-designer.png
  3. 374
      aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc.json
  4. 209
      aws-cloudformation-demo/cloudcomp-counter-demo.json

BIN
aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc-designer (1).png

Before

Width: 2046  |  Height: 2046  |  Size: 299 KiB

BIN
aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc-designer.png

After

Width: 2163  |  Height: 2163  |  Size: 316 KiB

374
aws-cloudformation-demo/cloudcomp-counter-demo-with-vpc.json

@ -1,26 +1,29 @@
{ {
"AWSTemplateFormatVersion": "2010-09-09", "AWSTemplateFormatVersion": "2010-09-09",
"Parameters":
{
"paramImageID" : {
"Type" : "AWS::EC2::Image::Id",
"Default" : "ami-f573e19a",
"Description" : "Amazon Image ID (Amazon Linux), Frankfurt ami-f573e19a, N. Virginia ami-4dd18837"
},
"paramInstanceType" : {
"Type" : "String",
"Default" : "t2.nano",
"AllowedValues" : ["t2.nano", "t2.micro", "m1.small"],
"Description" : "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
},
"paramKeyPair" : {
"Type" : "AWS::EC2::KeyPair::KeyName",
"Description" : "Amazon EC2 Key Pair"
},
"paramIamInstanceRole" : {
"Type" : "String",
"Parameters": {
"paramImageID": {
"Type": "AWS::EC2::Image::Id",
"Default": "ami-f573e19a",
"Description": "Amazon Image ID (Amazon Linux), Frankfurt ami-f573e19a, N. Virginia ami-4dd18837"
},
"paramInstanceType": {
"Type": "String",
"Default": "t2.nano",
"AllowedValues": [
"t2.nano",
"t2.micro",
"m1.small"
],
"Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
},
"paramKeyPair": {
"Type": "AWS::EC2::KeyPair::KeyName",
"Description": "Amazon EC2 Key Pair"
},
"paramIamInstanceRole": {
"Type": "String",
"Default": "ec2-s3-vertsys-access-role", "Default": "ec2-s3-vertsys-access-role",
"Description" : "IAM Instance Role"
"Description": "IAM Instance Role"
} }
}, },
"Resources": { "Resources": {
@ -28,11 +31,23 @@
"Type": "AWS::AutoScaling::LaunchConfiguration", "Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": { "Properties": {
"AssociatePublicIpAddress": true, "AssociatePublicIpAddress": true,
"ImageId": { "Ref" : "paramImageID" },
"InstanceType": { "Ref" : "paramInstanceType" },
"KeyName": { "Ref" : "paramKeyPair" },
"IamInstanceProfile": { "Ref" : "paramIamInstanceRole" },
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ],
"ImageId": {
"Ref": "paramImageID"
},
"InstanceType": {
"Ref": "paramInstanceType"
},
"KeyName": {
"Ref": "paramKeyPair"
},
"IamInstanceProfile": {
"Ref": "paramIamInstanceRole"
},
"SecurityGroups": [
{
"Ref": "sgCloudCompDemoSecurityGroup"
}
],
"UserData": { "UserData": {
"Fn::Base64": { "Fn::Base64": {
"Fn::Join": [ "Fn::Join": [
@ -115,87 +130,156 @@
} }
} }
}, },
"vpcCloudCompCounterDemo" : {
"Type" : "AWS::EC2::VPC",
"Properties" : {
"CidrBlock" : "10.0.0.0/16",
"EnableDnsSupport" : "true",
"EnableDnsHostnames" : "true",
"Tags" : [ {"Key" : "Name", "Value" : "vpcCloudCompCounterDemo"} ]
"vpcCloudCompCounterDemo": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "10.0.0.0/16",
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true",
"Tags": [
{
"Key": "Name",
"Value": "vpcCloudCompCounterDemo"
}
]
} }
}, },
"subnetCloudCompCounterDemoPublicSubnetAz1" : {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" },
"CidrBlock" : "10.0.0.0/24",
"AvailabilityZone" : { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] },
"Tags" : [ {"Key" : "Name", "Value" : "subnetCloudCompCounterDemoPublicSubnetAz1"} ]
"subnetCloudCompCounterDemoPublicSubnetAz1": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"CidrBlock": "10.0.0.0/24",
"AvailabilityZone": {
"Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
},
"Tags": [
{
"Key": "Name",
"Value": "subnetCloudCompCounterDemoPublicSubnetAz1"
}
]
}
},
"subnetCloudCompCounterDemoPublicSubnetAz2": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"CidrBlock": "10.0.1.0/24",
"AvailabilityZone": {
"Fn::Select": [
"1",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
} }
}
]
}, },
"subnetCloudCompCounterDemoPublicSubnetAz2" : {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" },
"CidrBlock" : "10.0.1.0/24",
"AvailabilityZone" : { "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] },
"Tags" : [ {"Key" : "Name", "Value" : "subnetCloudCompCounterDemoPublicSubnetAz2"} ]
"Tags": [
{
"Key": "Name",
"Value": "subnetCloudCompCounterDemoPublicSubnetAz2"
}
]
} }
}, },
"igCloudCompCounterDemo": { "igCloudCompCounterDemo": {
"Type" : "AWS::EC2::InternetGateway",
"Properties" : {
"Tags" : [ {"Key" : "Name", "Value" : "igCloudCompCounterDemo"} ]
"Type": "AWS::EC2::InternetGateway",
"Properties": {
"Tags": [
{
"Key": "Name",
"Value": "igCloudCompCounterDemo"
}
]
} }
}, },
"attachGateway": { "attachGateway": {
"Type" : "AWS::EC2::VPCGatewayAttachment",
"Properties" : {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" },
"InternetGatewayId": { "Ref" : "igCloudCompCounterDemo" }
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"InternetGatewayId": {
"Ref": "igCloudCompCounterDemo"
}
} }
}, },
"routetableViaIgw": { "routetableViaIgw": {
"Type" : "AWS::EC2::RouteTable",
"Properties" : {
"VpcId": { "Ref" : "vpcCloudCompCounterDemo" },
"Tags" : [ {"Key" : "Name", "Value" : "routetableViaIgw"} ]
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "vpcCloudCompCounterDemo"
},
"Tags": [
{
"Key": "Name",
"Value": "routetableViaIgw"
}
]
} }
}, },
"publicrouteViaIgw": { "publicrouteViaIgw": {
"Type" : "AWS::EC2::Route",
"DependsOn" : "attachGateway",
"Properties" : {
"RouteTableId": { "Ref" : "routetableViaIgw" },
"Type": "AWS::EC2::Route",
"DependsOn": "attachGateway",
"Properties": {
"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",
"Properties" : {
"SubnetId": { "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz1" },
"RouteTableId": { "Ref" : "routetableViaIgw" }
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"Ref": "subnetCloudCompCounterDemoPublicSubnetAz1"
},
"RouteTableId": {
"Ref": "routetableViaIgw"
}
} }
}, },
"publicsubnet1RouteTableAssociation": {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId": { "Ref" : "subnetCloudCompCounterDemoPublicSubnetAz2" },
"RouteTableId": { "Ref" : "routetableViaIgw" }
"publicsubnet2RouteTableAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"SubnetId": {
"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": [ "/", [
"app/elbCloudCompLoadBalancer", { "Fn::Select": [ "3", { "Fn::Split": [ "/", { "Ref": "elbCloudCompLoadBalancer" } ] } ] },
"targetgroup/elbCloudCompTargetGroup", { "Fn::Select": [ "2", { "Fn::Split": [ "/", { "Ref": "elbCloudCompTargetGroup" } ] } ] }
"ResourceLabel": {
"Fn::Join": [
"/",
[
"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":
{
"LoadBalancer" : {
"Outputs": {
"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"

209
aws-cloudformation-demo/cloudcomp-counter-demo.json

@ -1,38 +1,41 @@
{ {
"AWSTemplateFormatVersion": "2010-09-09", "AWSTemplateFormatVersion": "2010-09-09",
"Parameters":
{
"paramImageID" : {
"Type" : "AWS::EC2::Image::Id",
"Default" : "ami-f573e19a",
"Description" : "Amazon Image ID"
},
"paramInstanceType" : {
"Type" : "String",
"Default" : "t2.nano",
"AllowedValues" : ["t2.nano", "t2.micro", "m1.small"],
"Description" : "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
},
"paramKeyPair" : {
"Type" : "AWS::EC2::KeyPair::KeyName",
"Description" : "Amazon EC2 Key Pair"
},
"paramIamInstanceRole" : {
"Type" : "String",
"Parameters": {
"paramImageID": {
"Type": "AWS::EC2::Image::Id",
"Default": "ami-f573e19a",
"Description": "Amazon Image ID"
},
"paramInstanceType": {
"Type": "String",
"Default": "t2.nano",
"AllowedValues": [
"t2.nano",
"t2.micro",
"m1.small"
],
"Description": "Enter t2.micro, m1.small, or m1.large. Default is t2.micro."
},
"paramKeyPair": {
"Type": "AWS::EC2::KeyPair::KeyName",
"Description": "Amazon EC2 Key Pair"
},
"paramIamInstanceRole": {
"Type": "String",
"Default": "ec2-s3-vertsys-access-role", "Default": "ec2-s3-vertsys-access-role",
"Description" : "IAM Instance Role"
"Description": "IAM Instance Role"
}, },
"paramVPC" : {
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VPC"
"paramVPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "VPC"
}, },
"paramSubnetIDs" : {
"Type" : "List<AWS::EC2::Subnet::Id>",
"Description" : "Subnet IDs"
"paramSubnetIDs": {
"Type": "List<AWS::EC2::Subnet::Id>",
"Description": "Subnet IDs"
}, },
"paramAvailabilityZones" : {
"Type" : "List<AWS::EC2::AvailabilityZone::Name>",
"Description" : "AvailabilityZones"
"paramAvailabilityZones": {
"Type": "List<AWS::EC2::AvailabilityZone::Name>",
"Description": "AvailabilityZones"
} }
}, },
"Resources": { "Resources": {
@ -40,11 +43,23 @@
"Type": "AWS::AutoScaling::LaunchConfiguration", "Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": { "Properties": {
"AssociatePublicIpAddress": true, "AssociatePublicIpAddress": true,
"ImageId": { "Ref" : "paramImageID" },
"InstanceType": { "Ref" : "paramInstanceType" },
"KeyName": { "Ref" : "paramKeyPair" },
"IamInstanceProfile": { "Ref" : "paramIamInstanceRole" },
"SecurityGroups": [ { "Ref": "sgCloudCompDemoSecurityGroup" } ],
"ImageId": {
"Ref": "paramImageID"
},
"InstanceType": {
"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" },
"TargetGroupARNs": [ { "Ref": "elbCloudCompTargetGroup" } ],
"AvailabilityZones": {
"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": [ "/", [
"app/elbCloudCompLoadBalancer", { "Fn::Select": [ "3", { "Fn::Split": [ "/", { "Ref": "elbCloudCompLoadBalancer" } ] } ] },
"targetgroup/elbCloudCompTargetGroup", { "Fn::Select": [ "2", { "Fn::Split": [ "/", { "Ref": "elbCloudCompTargetGroup" } ] } ] }
"ResourceLabel": {
"Fn::Join": [
"/",
[
"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" } ],
"Subnets": { "Ref": "paramSubnetIDs" }
"SecurityGroups": [
{
"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":
{
"LoadBalancer" : {
"Outputs": {
"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"
Loading…
Cancel
Save