`Fn::ForEach` Supported but an error is thrown on the CLI
Opened this issue · 0 comments
jackylamhk commented
Issue description
When a Fn::ForEach
block is included, the Serverless CLI throws an error:
Warning: Invalid configuration encountered
at 'resources.Resources': unrecognized property 'Fn::ForEach::LoopName'
However, upon inspecting the generated CloudFormation template it seems to generates the loop resources fine.
Context
I would also suggest to add this to the documentation as it is already implicitly supported.
The correct syntax looks like:
resources:
Transform: AWS::LanguageExtensions
Resources:
Fn::ForEach::LoopName:
- VarName
- - Foo
- Bar
- ${VarName}SomeResource:
SomeProperty: !Ref VarName
SomeNestedRef:
Ref: !Sub ${VarName}Suffix