aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

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

Open
#2,150 0 comments 0 reactions 0 assignees View on GitHub
NeedTriage other
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the Fn::ForEach behavior described in the issue, especially how &{Identifier} is handled in OutputKey versus OutputValue. Done means selecting a supported way for resources created in an iteration to be referenced by other resources; the issue names no repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.