Closed throrin19 closed 1 year ago
I don't think this is currently possible. Nesting $forEach
is supported, but the plugin does a depth-first traversal to avoid ambiguity.
There is no solution to made this, or an example for nesting $forEach
?
I try to remove ambiguity with $forEach_named
but the problem is the same. This plugin does not respond to this use case....
As I mentioned above, the plugin supports nesting, but it interpolates nested $forEach
before the parent one. There are two tests that show how this works for objects and arrays.
I resolve my problem using @cruglobal/serverless-merge-config
with this plugin :
custom
foo:
$<<:
- DB_PASSWORD_BAR_ONE: value
DB_HOST_BAR_ONE: value
- DB_PASSWORD_BAR_TWO: value
DB_HOST_BAR_TWO: value
provider:
environment:
$forEach:
iterator: ${self:custom.foo}
template:
$forEach.key: $forEach.value
plugins:
- '@cruglobal/serverless-merge-config'
- serverless-plugin-for-each
Hello, Is it possible to made a
$forEach
inside another$forEach
?In my case I have this configuration in my custom part :
And I want made this in
provider.environment
:I've try this with $forEach plugin :
But I have this error :