@@ -457,13 +457,14 @@ Modules are not allowed to refer to themselves directly or in cycles. Module A
457457can’t import Module A, and it can’t import Module B if that module imports
458458Module A.
459459
460- Modules support a basic form of looping/foreach by adding a `Map` attribute to
461- the module configuration. Special variables `$MapIndex` and `$MapValue` can be
462- used to refer to the index and list value. Logical Ids are auto-incremented by
460+ Modules support a basic form of looping/foreach by either using the familiar
461+ `Fn::ForEach` syntax, or with a shorthand by adding a `ForEach` attribute to
462+ the module configuration. Special variables `$Identifier` and `$Index` can be
463+ used to refer to the value and list index. With the shorthand, or if you don't
464+ put the Identifier in the logical id, logical ids are auto-incremented by
463465adding an integer starting at zero. Since this is a client-side-only feature,
464466list values must be fully resolved scalars, not values that must be resolved at
465- deploy time. When deploy-time values are needed, `Fn::ForEach` is a better
466- design option. Local modules do not process `Fn::ForEach`.
467+ deploy time.
467468
468469```
469470Parameters:
@@ -474,7 +475,7 @@ Parameters:
474475Modules:
475476 Content:
476477 Source: ./map-module.yaml
477- Map : !Ref List
478+ ForEach : !Ref List
478479 Properties:
479480 Name: !Sub my-bucket-$MapValue
480481```
@@ -506,15 +507,12 @@ It’s also possible to refer to elements within a `Map` using something like
506507which resolves to a list of all of the `Arn` outputs from that module.
507508
508509When a module is processed, the first thing that happens is parsing of the
509- `Conditions` within the module. These conditions must be fully resolvable
510- client-side, since the package command does not have access to Parameters or
511- deploy-time values. These conditions are converted to a dictionary of boolean
512- values and the `Conditions` section is not emitted into the parent template. It
513- is not merged into the parent. Any resources marked with a false condition are
514- removed, and any property nodes with conditions are processed. Any values of
515- `!Ref AWS::NoValue` are removed. No evidence of conditions will remain in the
516- markup that is merged into the parent template, unless the condition is not
517- found in the module.
510+ Conditions within the module. Any Resources, Modules, or Outputs marked with a
511+ false condition are removed, and any property nodes with conditions are
512+ processed. Any values of !Ref AWS::NoValue are removed. Any unresolved
513+ conditions (for example, a condition that references a paramter in the parent
514+ template, or something like AWS::Region) are emitted into the parent template,
515+ prefixed with the module name.
518516
519517Much of the value of module output is in the smart handling of `Ref`,
520518`Fn::GetAtt`, and `Fn::Sub`. For the most part, we want these to “just work” in
@@ -612,11 +610,6 @@ Modules:
612610 Source: $def/a/b/bar.yaml
613611```
614612
615-
616-
617-
618-
619-
620613### Publish modules to CodeArtifact
621614
622615Rain integrates with AWS CodeArtifact to enable an experience similar to npm
0 commit comments