I am trying to use cloudformation to setup a ASG and I have a target group which I would like to associate with the ASG. The target group is created okay but when I go to attach it to the ASG I get an error message. I'd like to be able to attach this as I want a ALB in front of the ASG
Error message:
Value of property TargetGroupARNs must be of type List of String
Cloudformation code
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
VpcId:
Fn::ImportValue:
!Sub "${Prefix}-VpcId"
TargetType: instance
Port: 443
Protocol: HTTPS
AutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
AutoScalingGroupName: Autoscaling Group Alpha
Cooldown: 120
DesiredCapacity: 1
LaunchConfigurationName: AlphaLaunchConfiguration
MaxSize: 1
MinSize: 1
Tags:
-
Key: Name
Value: Alpha ASG
PropagateAtLaunch: 'true'
TargetGroupARNs:
Ref: TargetGroup
TargetGroupARNs
is neither aList
orString
.