10000 Cloud Formation: [POC] Update Graph with Template Traversal & Intrinsic Function Resolution by MEPalma · Pull Request #12378 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Cloud Formation: [POC] Update Graph with Template Traversal & Intrinsic Function Resolution #12378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MEPalma
Copy link
Contributor
@MEPalma MEPalma commented Mar 12, 2025

Motivation

With the recent changes in #12355, we introduced a new design pattern for representing CloudFormation templates. However, that design did not account for deeper intra-template relationships, preventing accurate detection of indirect resource changes driven by dependencies or intrinsic functions. This PR addresses those limitations by introducing logic to traverse and resolve template elements and intrinsic functions, ensuring that updates and dependencies are correctly captured. It also resolves issues comparing null or empty template versions.

Changes

  • Add logic to lazily traverse template files during update graph construction, capturing indirect changes driven by dependencies and intrinsic function evaluations.
  • Introduce a pattern for resolving intrinsic functions, applied both while building the update graph and during ChangeSetDescribe operations.
  • Improve comparison logic for null or empty template versions, ensuring changes are accurately detected.
  • Integrate new provider (if PROVIDER_OVERRIDE_CLOUDFORMATION=engine-v2 is supplied) with create and describe change set

Testing

  • Includes temporary unit tests for the describe functionality, set for removal once the update graph POC is integrated in the CFN engine-v2 provide.

@MEPalma MEPalma added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Mar 12, 2025
@MEPalma MEPalma added this to the 4.3 milestone Mar 12, 2025
@MEPalma MEPalma self-assigned this Mar 12, 2025
Copy link
github-actions bot commented Mar 12, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   20m 27s ⏱️ - 1h 31m 32s
422 tests  - 3 703  310 ✅  - 3 495  112 💤  - 208  0 ❌ ±0 
424 runs   - 3 703  310 ✅  - 3 495  114 💤  - 208  0 ❌ ±0 

Results for commit 06308e5. ± Comparison against base commit 257af99.

This pull request removes 3703 tests.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…

♻️ This comment has been updated with latest results.

Copy link
Contributor
@simonrw simonrw left a comment

Choose a reason for hiding this comment

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

This is a nice set of changes! I look forward to pushing this work forwards

@MEPalma MEPalma merged commit 621f68d into master Mar 18, 2025
31 checks passed
@MEPalma MEPalma deleted the MEP-CFN-POC-describe_change_set_intrinsic_functions_resolution branch March 18, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0