AWS CloudFormation problem with #{each...}

Hi,
I’m trying to set up a Step Template for AWS CloudFormation.
When trying to save the Template Srouce, it fails with this message: The CloudFormation template parser failed for the supplied input. Ensure the template code is well formed
I think it is because of this part:

"SecurityGroups": [
    #{each sg in AwsEcsStep2.SecurityGroups}
    "#{sg}",
    #{/each}
],

Is Extended Syntax not supported for CloudFormation step, and can anyone offer an alternative, when I don’t know the number of items in an array in advance?
I’m using Octopus Deploy v2019.3.5 LTS

I found a workaround, using the Fn:Split CloudFormation function, like this:

"SecurityGroups": {
  "Fn::Split": [
    ",",
    "#{AwsEcsStep2.SecurityGroups}"
  ]
}

Hi @tmh,

Thanks for the update here! I’m glad to hear you resolved your issue.

Please feel free to get in touch at any time if you have any further questions or issues.

Best regards,
Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.