Failing to parse valid CloudFormation template

I’m trying to update a CloudFormation template step, but the step is saying it’s unable to parse the YAML, but it works fine when deployed through the AWS console. Can you assist in telling me what is wrong? I can’t seem to zero in on the problem area.

eks-nodegroup.yaml (11.9 KB)

Hi Chris,

Thanks for reaching out!

Looks like the parse error is due to having duplicate keys in the LaunchTemplate overrides:

      Overrides:
        -InstanceType: t3.xlarge    # 0.1664  70%   5-10%
        -InstanceType: t3a.xlarge   # 0.1504  70%   15-20%
        -InstanceType: t2.xlarge    # 0.1856  70%   15-20%
        -InstanceType: m5a.xlarge   # 0.1720  61%   >20%
        -InstanceType: m5.xlarge    # 0.1920  65%   10-15%
        -InstanceType: m5d.xlarge   # 0.2260  70%   <5%
        -InstanceType: m4.xlarge    # 0.2000  67%   <5%
        -InstanceType: c5.2xlarge   # 0.3400  62%   10-15%
        -InstanceType: c5d.2xlarge  # 0.3840  66%   >20%
        -InstanceType: c5n.2xlarge  # 0.4320  70%   >20%

I’m not aware if you are able to supply more than one, the AWS console may just be ignoring the duplicate values.

Hope this helps!

That is actually valid. It’s part of their new mixed instances policy stuff.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html

Is there any way to express this so that Octopus will accept it?

Good news Chris,

You just need to add a space between the"-" and “InstanceType”

Overrides:
        - InstanceType: t3.xlarge    # 0.1664  70%   5-10%
        - InstanceType: t3a.xlarge   # 0.1504  70%   15-20%
        - InstanceType: t2.xlarge    # 0.1856  70%   15-20%
        - InstanceType: m5a.xlarge   # 0.1720  61%   >20%
        - InstanceType: m5.xlarge    # 0.1920  65%   10-15%
        - InstanceType: m5d.xlarge   # 0.2260  70%   <5%
        - InstanceType: m4.xlarge    # 0.2000  67%   <5%
        - InstanceType: c5.2xlarge   # 0.3400  62%   10-15%
        - InstanceType: c5d.2xlarge  # 0.3840  66%   >20%
        - InstanceType: c5n.2xlarge  # 0.4320  70%   >20%

Cheers,
Frank

Yeah I suppose that’s what I’m doing everywhere else :slight_smile: Should have seen it. Thanks for your help.

No worries, took me a while too!