0
votes

AWS CFN build is failing with status "Value of property TargetGroupARNs must be of type List of String" for the following autoscalling group:

InfyASG:
  Type: AWS::AutoScaling::AutoScalingGroup
  UpdatePolicy:
    AutoScalingRollingUpdate:
      MaxBatchSize: "4"
      MinInstancesInService:
        Ref: InfyASGMin
  Properties:
    Cooldown: "300"
    DesiredCapacity:
      Ref: InfyASGDesiredSize
    MaxSize:
      Ref: InfyASGMaxSize
    MinSize:
      Ref: InfyASGMin
    HealthCheckGracePeriod: "300"
    HealthCheckType: ELB
    VPCZoneIdentifier:
      Ref: PrivateSubnet
    LaunchConfigurationName:
      Ref: InfyLaunchConfig
    TargetGroupARNs:
      - !GetAtt "InfyTG.LoadBalancerArns"
    Tags:
      - Key: Owner
        Value:
          Ref: BaseOwner
        PropagateAtLaunch: true
      - Key: Name
        Value:
          Fn::Sub: ${BaseName}-${Environment}-InfyASG
        PropagateAtLaunch: true
      - Key: Application
        Value:
          Ref: Application
        PropagateAtLaunch: true
      - Key: Environment
        Value:
          Ref: Environment
        PropagateAtLaunch: true
      - Key: Role
        Value:
          Fn::Sub: ${BaseName}-${Environment}-Role
        PropagateAtLaunch: true

My target group name is "InfyTG". Only "TargetGroupARNs" was given under autoscaling group for mapping. I also have used the following, but that did not work.

      TargetGroupARNs:
        Ref: InfyTG

Should be problem mapping targetgroup to autoscaling group. I try searching how the mapping will be between autoscaling group, target group, application load balancer but it didn't helped me fixing the above problem.

All I need is highly available application server under a target group so that I can route the traffic through application load balancer to the instance. If the instance is down, autoscalling group should generate new one and register it under the same target group.

Kindly help me with this.

1

1 Answers

0
votes

Try this:

  TargetGroupARNs: [!Ref InfyTG]

Alternatively (and you were close with your second form):

  TargetGroupARNs: 
    - !Ref InfyTG