cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

Fn::ForEach can't ref logical ids of resources created with &{Identifier}

Open boonew2 opened this issue 1 year ago • 0 comments
trafficstars

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:

  • 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....

boonew2 avatar Oct 01 '24 15:10 boonew2