Repository navigation
Description
Summary
Four intrinsics are parsed and expanded but never resolved. A template using one
deploys with a literal where a value should be:
| Intrinsic | Why it is unresolved |
|---|---|
Fn::FindInMap |
cfnTemplate has no Mappings field at all — zero occurrences in emulator/betty_cfn.go. There is nothing to resolve against |
Fn::ImportValue |
Cross-stack exports are not modelled: Outputs has no Export handling, so there is no export registry to import from |
Fn::Cidr |
List-valued, so it hits the resolver-shape problem in #521 as well as being unimplemented |
Fn::GetAZs |
List-valued likewise; needs a per-region AZ list, which EC2 already has for DescribeAvailabilityZones |
Fn::FindInMap is the one that matters most: a region→AMI map is one of the most
common things a real template does, and the failure is silent —
resolveValue falls back to JSON-encoding the unrecognized intrinsic, so an
ImageId becomes the literal {"Fn::FindInMap":["RegionMap","us-east-1","AMI"]}
and the instance launches with a nonsense AMI rather than the stack failing.
v0.87.1 (#516) made all four reachable from conventional YAML: !FindInMap and
friends are now expanded to their long forms, where before the tag was dropped
entirely. Expansion is still the right behaviour — it makes the two syntaxes
identical, which is the invariant #516 was about — but "expanded" must not be read
as "resolved", and docs/services.md now says so explicitly.
Priority note
None of the five parsl-aws-provider templates use any of the four, which is why
this was not on v0.87.1's critical path. It is filed because expansion makes them
reachable and because Mappings is a real gap for anyone writing a
region-portable template.
Acceptance criteria
-
cfnTemplatecarriesMappings, andFn::FindInMapresolves a
three-level map, including the nested-key form
(Fn::FindInMap [Map, TopKey, SecondKey]). -
Fn::FindInMapwith an unknown key behaves as CloudFormation does (a
template error, not a silent literal). -
Fn::GetAZsresolves against the same AZ list EC2's
DescribeAvailabilityZonesreports, so the two cannot disagree, and
Fn::GetAZs ''resolves against the caller's region. -
Fn::Cidrresolves per the documentedipBlock/count/cidrBits
semantics. -
Fn::ImportValueresolves against an export registry populated by another
stack'sOutputs.*.Export.Name, and refuses to delete a stack whose export
is still imported — which is the behaviour that makes exports worth modelling
rather than faking. - Both list-valued cases depend on, or land with, CloudFormation: Fn::Split resolves to its first element only, so a split list silently loses everything after the first item #521.
- The unresolved list in
docs/services.mdshrinks accordingly.
Provenance
Confirmed by reading resolveValue and evalConditionExpr in
emulator/betty_cfn.go: the switch handles Ref, Fn::Sub, Fn::Join,
Fn::Select, Fn::Split, Fn::Base64, Fn::GetAtt, Fn::If and the condition
functions, and nothing else. Mappings absence confirmed by grep. Documented as a
known limitation in docs/services.md.
Activity
scttfrdmn commentedon Aug 3, 2026
Milestoned to v0.88.0, as the third PR of the resolver cluster.
Depends on #521. Two of the four intrinsics here are list-valued —
Fn::GetAZsreturns a list of AZ names andFn::Cidra list of CIDR blocks — so both land on theresolveValueListseam #521 adds. Doing this first would mean writing a second list path and then merging them.Findings from planning, which change or sharpen the scope:
Fn::FindInMapmust fail, not fall back.resolveValue's final arm is ajson.Marshalfallback, so an unresolvedFn::FindInMaptoday emits the literal JSON of the intrinsic itself as the property value. For the canonical region→AMI mapping that means anImageIdof{"Fn::FindInMap":["RegionMap","us-east-1","AMI"]}— and the instance launches, because substrate does not validate AMI IDs. OnceMappingsexists, an unknown map name / top-level key / second-level key must fail the resource (real CloudFormation returnsValidationError), not silently produce a literal. Otherwise the fix converts a wrong-value bug into a wrong-value bug that is harder to spot.Fn::GetAZshas to agree with the EC2 plugin. Substrate already answersDescribeAvailabilityZones. IfFn::GetAZssynthesizes its own list, a template that selects!Select [0, !GetAZs ""]and a caller that readsDescribeAvailabilityZonessee different AZs for the same region, which is a fresh inconsistency rather than a fixed one. It must resolve against the same source.!GetAZs ""uses the caller's region.Fn::ImportValueneedsExportoncfnOutput, which does not exist.cfnOutput(emulator/betty_cfn.go:42) carries onlyValueandDescription— there is noExportfield at all, so there is nowhere for an export name to come from. The export registry has to be populated fromOutputs.*.Export.Name, which means adding the field first. And the part that makes exports worth modelling rather than faking: refusing to delete a stack whose export is still imported. Real CloudFormation returnsValidationErrornaming the importing stacks. Without that refusal, an export registry is just a lookup table.Four unresolved pseudo-parameters belong in this issue. They are in the same
resolveRefswitch (:3157-3178) anddocs/services.md:215documents them as unresolved in the same paragraph as these intrinsics, so shortening that list without closing it leaves the docs in an odd half-state:AWS::Partition→awsAWS::URLSuffix→amazonaws.comAWS::StackId— nearly free:cfnStackID(emulator/cloudformation_plugin.go:1086) already builds a deterministic stack ARN forCreateStack's response. It only needs threading ontocfnContext.AWS::NotificationARNs→ empty list, with a note that substrate has no notification model.Adding a criterion:
AWS::Partition,AWS::URLSuffix,AWS::StackIdandAWS::NotificationARNsresolve, anddocs/services.md's unresolved-pseudo-parameter list is removed rather than shortened.Possible split. If the implementation outgrows #521 and #526/#527 combined,
Fn::ImportValuecomes out into its own PR — the export registry plus the delete-refusal is a new cross-stack model, whereas the other three are resolvers. TheMappingswork and the pseudo-parameters stay together.One coupling to watch, relevant to #502. Both new failure modes here (unknown map key, refusing to delete an imported-from stack) need an AWS error code on the wire, and no substring in
cfnMapDeployerErrormatches either. If either surfaces throughDeploy/DeleteStack's error return, #502's typed sentinels should land in this release rather than widening the substring switch. If both are recorded on the resource instead — which v0.87.1's #519 work makes the natural choice — the mapper is untouched. Decide that when implementing; see the note on #502.fix(cfn): read Mappings and resolve FindInMap, GetAZs, Cidr and the p…