GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CloudFormation: Support nested intrinsic functions in Fn::FindInMap by nik-localstack · Pull Request #13678 · localstack/localstack

This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Conversation

@nik-localstack

@nik-localstack nik-localstack commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation

When redeploying CloudFormation stacks that contain Fn::FindInMap with nested intrinsic functions (like {"Ref": "AWS::Partition"}), LocalStack raised a misleading error:

InternalFailure: The API action 'CreateChangeSet' for service 'cloudformation' is either not available in your current license plan or has not yet been emulated by LocalStack.

This particularly affected CDK-generated templates that use CloudFront distributions with Route53 ARecord alias targets, where the hosted zone ID is determined using:

{
  "Fn::FindInMap": [
    "AWSCloudFrontPartitionHostedZoneIdMap",
    {"Ref": "AWS::Partition"},
    "zoneId"
  ]
}

Changes

Modified _resolve_intrinsic_function_fn_find_in_map in the changeset model to handle non-terminal values (nested intrinsic functions) by calling parent_change_type_of() instead of raising NotImplementedError.

Tests

Added 3 AWS-validated tests to test_change_set_mappings.py to validate the exact bug scenario and that change detection still works correctly.

Related

Fixes #13491
Closes UNC-165

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nik-localstack nik-localstack self-assigned this Feb 2, 2026
@nik-localstack nik-localstack added aws:cloudformation AWS CloudFormation semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Feb 2, 2026
@github-actions

github-actions Bot commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results - Preflight, Unit

23 088 tests  ±0   21 229 ✅ ±0   6m 2s ⏱️ -20s
     1 suites ±0    1 859 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 3aefe4c. ± Comparison against base commit 39ec7cf.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

LocalStack Community integration with Pro

  2 files    2 suites   30m 53s ⏱️
586 tests 473 ✅ 113 💤 0 ❌
588 runs  473 ✅ 115 💤 0 ❌

Results for commit 3aefe4c.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 1s ⏱️ -2s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 3aefe4c. ± Comparison against base commit 39ec7cf.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   43m 31s ⏱️
610 tests 498 ✅ 112 💤 0 ❌
616 runs  498 ✅ 118 💤 0 ❌

Results for commit 3aefe4c.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Feb 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Test Results - Alternative Providers

585 tests   322 ✅  17m 43s ⏱️
  1 suites  263 💤
  1 files      0 ❌

Results for commit 3aefe4c.

♻️ This comment has been updated with latest results.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nik-localstack
nik-localstack marked this pull request as ready for review February 2, 2026 15:21
@nik-localstack
nik-localstack requested review from dominikschubert, pinzon and simonrw as code owners February 2, 2026 15:21
@nik-localstack nik-localstack added the aws:cloudformation:v2 Issues related to the V2 CloudFormation engine label Feb 2, 2026
@nik-localstack nik-localstack added this to the 4.14 milestone Feb 2, 2026
pinzon
pinzon approved these changes Feb 2, 2026
View reviewed changes

@pinzon pinzon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR. Thank you for fixing the issue and tackling a todo at the same time. I just have a minor comment for the last test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/aws/services/cloudformation/test_change_set_mappings.py Outdated
Comment on lines +471 to +501
template_2 = {
"Parameters": {
"Environment": {
"Type": "String",
"Default": "dev", # Changed from "prod"
}
},
"Mappings": {
"ComplexMap": {
"prod": {"aws": "prod-aws-value"},
"dev": {"aws": "dev-aws-value"},
}
},
"Resources": {
"Topic1": {
"Type": "AWS::SNS::Topic",
"Properties": {
"TopicName": name1,
"DisplayName": {
"Fn::FindInMap": [
"ComplexMap",
{"Ref": "Environment"},
{"Ref": "AWS::Partition"},
]
},
},
}
},
}

capture_update_process(snapshot, template_1, template_2)

@pinzon pinzon Feb 2, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: capture_update_process supports passing parameters, you could simply pass the environment as a parameter and save 30 lines of code. Unless you're really interested on testing the default parameter.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nik-localstack reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nik-localstack
CloudFormation: Support nested intrinsic functions in Fn::FindInMap
3aefe4c
@nik-localstack
nik-localstack force-pushed the unc-165-resolve-cfn-notimplementederror branch from 52fba9e to 3aefe4c Compare February 3, 2026 09:13
@nik-localstack
nik-localstack merged commit e5fc583 into main Feb 3, 2026
43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nik-localstack
nik-localstack deleted the unc-165-resolve-cfn-notimplementederror branch February 3, 2026 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@simonrw simonrw Awaiting requested review from simonrw
@dominikschubert dominikschubert Awaiting requested review from dominikschubert dominikschubert is a code owner
1 more reviewer
@pinzon pinzon pinzon approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@nik-localstack nik-localstack

Labels

aws:cloudformation:v2 Issues related to the V2 CloudFormation engine aws:cloudformation AWS CloudFormation docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Milestone

4.14

Development

Successfully merging this pull request may close these issues.

bug: Redeploying an ARecord with CDK does not work when the Hosted Zone is created in another stack and retrieved with SSM Parameters

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@nik-localstack @pinzon
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.