The &{Identifier} syntax strips non alpha-numeric chars from the iterating identifier, but that syntax only works in the OutputKey and not the OutputValue. This means that you can create resources in the Fn::ForEach that can't be referenced by other resources in the iteration.
I think this could be functionally resolved a few different ways:
Being able to resolve &{} in the OutputValue
Making something like Identifier.Index that is just a number that increments per iteration that could be used in the OutputKey
Allowing more nested structure of the collection being iterated on... maybe a pipe delimited tuple or something? So non.alpha.numeric01|X01,non.alpha.numeric02|X02 could be passed in and then unpacked into a matching number of identifiers specified
Allowing !Sub to work on the output key and then maybe the one above could be implemented through existing !Split / !Select function calls....
Resource Name
Fn::ForEach
Details
The
&{Identifier}
syntax strips non alpha-numeric chars from the iterating identifier, but that syntax only works in the OutputKey and not the OutputValue. This means that you can create resources in the Fn::ForEach that can't be referenced by other resources in the iteration.I think this could be functionally resolved a few different ways: