8000 Cloud Formation: [POC] Scoping Mechanism, Base Support for Parameters, Dynamic Parameters, Conditions, Intrinsic Functions, and Type Divergence by MEPalma · Pull Request #12405 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Cloud Formation: [POC] Scoping Mechanism, Base Support for Parameters, Dynamic Parameters, Conditions, Intrinsic Functions, and Type Divergence #12405

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
merged 14 commits into from
Mar 24, 2025

Conversation

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

Motivation

Currently, the POC Update Graph approach to modeling CloudFormation templates does not support CloudFormation Parameters or the Ref intrinsic function. Additionally, due to the lack of built-in positional identifiers, the ChangeSetEntity abstraction does not support workflows that need to track the asynchronous computation of template entities, nor does it enable memoization strategies.
These changes introduce a scoping mechanism that assigns each ChangeSetEntity a unique identifier representing its logical position (or scope) within the template. They also add support for modeling changes in Parameters, Dynamic Parameters, and Ref operations within change sets. Furthermore, unit tests have been added to cover basic scenarios in this context.

The POC Update Graph approach to modeling CloudFormation templates does not support CloudFormation Conditions. This gap prevents condition-driven workflows from being accurately tracked or updated within the existing logic. In addition, there is no support for certain intrinsic functions (such as Fn::If, Fn::Not, and Fn::Equals). Furthermore, the modeling layer does not currently handle scenarios where changes in a template result in a new subtype or intrinsic function (for example, switching from one intrinsic function to a different one). This limitation meant that strict type changes to certain template bindings was not supported. Finally, caching mechanisms within the describer visitor are needed. A number of minor issues with this pipeline were also addressed. Unit tests have been added to validate these scenarios.

Changes

  • Added initial scoping logic to the Update Graph building logic
  • Added base support for Parameter and Dynamic Parameters processing in the Update Graph building logic
  • Added base support for Ref intrinsic functions in the Update Graph building logic
  • Added base support for change set describes involving Parameters, Dynamic Parameters, and Ref
  • Added base support for modeling CloudFormation Conditions in the Update Graph building logic
  • Added modeling support for new intrinsic functions: Fn::If, Fn::Not, and Fn::Equals
  • Enabled propagation of condition changes throughout the update graph, including condition resource statements and references in intrinsic functions
  • Introduced the NodeDivergence concept, which models changes in subtype values (e.g., switching from one intrinsic function to another)
  • Implemented caching in the describer visitor to improve performance and clarity in describing template changes
  • Added support for describing change set changes involving conditions and the newly added intrinsic functions
  • Created unit tests covering conditions, new intrinsic functions, and the NodeDivergence mechanism
  • Several other minors

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

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   20m 2s ⏱️ - 1h 32m 16s
422 tests  - 3 883  310 ✅  - 3 674  112 💤  - 209  0 ❌ ±0 
424 runs   - 3 883  310 ✅  - 3 674  114 💤  - 209  0 ❌ ±0 

Results for commit 792c750. ± Comparison against base commit 64fbda1.

This pull request removes 3883 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.

…ns, Intrinsic Functions, and Type Divergences (#12421)
@MEPalma MEPalma changed the title Cloud Formation: [POC] Scoping Mechanism and Base Support for Parameters, Dynamic Parameters, and Ref Cloud Formation: [POC] Scoping Mechanism, Base Support for Parameters, Dynamic Parameters, Conditions, Intrinsic Functions, and Type Divergence Mar 24, 2025
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.

Thanks for implementing this, I'm excited to get these changes working!

@MEPalma MEPalma merged commit 0d63c5e into master Mar 24, 2025
33 checks passed
@MEPalma MEPalma deleted the MEP-CFN-POC-scope_and_parameters branch March 24, 2025 20:24
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