"ATargetGroup":{
"Type" : "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties" : {
"HealthCheckIntervalSeconds" : 30,
"HealthCheckPath" : "/healthcheck",
"HealthCheckPort" : 80,
"HealthCheckProtocol" : "HTTP",
"HealthCheckTimeoutSeconds" : 5,
"HealthyThresholdCount" : 5,
"Matcher" : {"HttpCode" : "200"},
"Name" : "a-http-tg",
"Port" : 80,
"Protocol" : "HTTP",
"TargetGroupAttributes" : [{"Key" : "deregistration_delay.timeout_seconds", "Value" : 10}],
"TargetType":"instance",
"Targets" : [{"Id":{"Ref":"instance1a"}, "Port" : 80}, {"Id":{"Ref":"instance1b"}, "Port" : 80}],
"UnhealthyThresholdCount" : 3,
"VpcId": {"Ref": "aVpc"}
}
},
"instance1a": {
"Type": "AWS::EC2::Instance",
"Properties": {
"DisableApiTermination": "false",
"InstanceInitiatedShutdownBehavior": "stop",
"ImageId": "ami-xxx",
"InstanceType": "t2.micro",
"KeyName": "AKeyPair",
"Monitoring": "false",
"Tags": [{"Key": "Name","Value": "ec2-1a"}],
"NetworkInterfaces": [
{
"DeleteOnTermination": "true",
"Description": "Primary network interface",
"DeviceIndex": 0,
"SubnetId": {"Ref": "SubNet1A"},
"PrivateIpAddresses": [{"PrivateIpAddress": "10.10.1.251","Primary": "true"}],
"GroupSet": [{"Ref": "Ec21aSg"}],
"AssociatePublicIpAddress": "true"
}
]
}
},
"instance1b": {
"Type": "AWS::EC2::Instance",
"Properties": {
"DisableApiTermination": "false",
"InstanceInitiatedShutdownBehavior": "stop",
"ImageId": "ami-xxx",
"InstanceType": "t2.micro",
"KeyName": "AKeyPair",
"Monitoring": "false",
"Tags": [{"Key": "Name","Value": "ec2-1b"}],
"NetworkInterfaces": [
{
"DeleteOnTermination": "true",
"Description": "Primary network interface",
"DeviceIndex": 0,
"SubnetId": {"Ref": "SubNet1b"},
"PrivateIpAddresses": [{"PrivateIpAddress": "10.10.2.32","Primary": "true"}],
"GroupSet": [{"Ref": "Ec21bSg"}],
"AssociatePublicIpAddress": "true"
}
]
}
}
Problem for me is, I got an error saying "instance1a" is an invalid type for this reference...
I am using AWS ToolKit (Version 1.14.4.0) for Visual Studio 2017.
Could it be that the Doc is incorrect? Or is it an issue in Aws ToolKit template intelligence?