AWS CloudFormation problem with #{each...}

(tmh) #1

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

(tmh) #2

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

"SecurityGroups": {
  "Fn::Split": [
    ",",
    "#{AwsEcsStep2.SecurityGroups}"
  ]
}
(Daniel Fischer) #4

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

(system) closed #5

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