You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cfn-lang-ext): document AWS::Include processing order vs language extensions
Add a section explaining that sam package processes Fn::Transform: AWS::Include
before language-extension expansion, mirroring CloudFormation's server-side
transform ordering. This means AWS::Include Location rewrites work correctly
even when the include lives buried inside language-extension functions like
Fn::ToJsonString or Fn::ForEach bodies.
locally. This mirrors CloudFormation's server-side transform pipeline,
272
+
where `Fn::Transform` macros are resolved before
273
+
`AWS::LanguageExtensions`.
274
+
275
+
The practical effect is that `AWS::Include` `Location` rewrites work
276
+
correctly even when the include lives buried inside language-extension
277
+
functions like `Fn::ToJsonString` or `Fn::ForEach` bodies, because the
278
+
include is rewritten while still structurally visible — before
279
+
`Fn::ToJsonString`collapses subtrees into JSON-string literals or
280
+
`Fn::ForEach`expands resources.
281
+
266
282
## Validation errors
267
283
268
284
The following template issues are caught locally before the SAM transform runs:
@@ -272,7 +288,7 @@ The following template issues are caught locally before the SAM transform runs:
272
288
| The `Fn::ForEach` value is malformed — not a list, doesn't have exactly 3 elements, or has a non-string loop identifier. | `Fn::ForEach::<key> layout is incorrect` (raised as `InvalidTemplateException`; see `samcli/lib/cfn_language_extensions/processors/foreach.py`). |
273
289
| More than 5 levels of `Fn::ForEach` are nested. | `Fn::ForEach nesting depth of <N> exceeds the maximum allowed depth of 5. CloudFormation supports up to 5 nested Fn::ForEach loops.` |
274
290
| The collection resolves to an empty list (e.g., a `CommaDelimitedList` parameter with `Default: ""`). | No error — the loop is silently skipped and no resources are emitted. |
275
-
| The `!Ref` in the collection points at a parameter that is not declared in the template. | No error in the typical `sam build` / `sam package` flow. SAM CLI runs intrinsic resolution in PARTIAL mode and preserves the unresolved `{"Ref": "<name>"}`. CloudFormation will reject the unresolved ref at deploy time. |
291
+
| The `!Ref` in the collection points at a parameter that is not declared in the template. | No error in the typical `sam build` / `sam package` flow. SAM CLI runs intrinsic resolution in PARTIAL mode and preserves the unresolved `{"Ref": "<name>"}`. At deploy time, CloudFormation will resolve it server side. |
0 commit comments