Skip to content

CloudFormation V2 Engine: Support for Fn::Sub #12650

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 4 commits into from
Jun 2, 2025
Merged

Conversation

MEPalma
Copy link
Contributor

@MEPalma MEPalma commented May 20, 2025

Motivation

The introduction of the CloudFormation v2 engine laid the foundation for a redesigned engine capable of accurately determining update requirements between CloudFormation deployments, while also enabling parallel execution during updates. However, the current implementation still lacks support for Fn::Sub intrinsic function.

Future efforts should add validation checks and cyclic reference detections.

Changes

  • Add support for Fn::Sub (modeling, describing, and executing)
  • Add base ChangeSet lifecycle test

@MEPalma MEPalma added this to the 4.5 milestone May 20, 2025
@MEPalma MEPalma self-assigned this May 20, 2025
@MEPalma MEPalma requested a review from dominikschubert as a code owner May 20, 2025 16:11
@MEPalma MEPalma added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label May 20, 2025
@MEPalma MEPalma requested review from pinzon and simonrw as code owners May 20, 2025 16:11
Copy link

github-actions bot commented May 20, 2025

Test Results - Preflight, Unit

21 579 tests   - 22   19 927 ✅  - 28   6m 13s ⏱️ +2s
     1 suites ± 0    1 652 💤 + 6 
     1 files   ± 0        0 ❌ ± 0 

Results for commit 2e175d8. ± Comparison against base commit 20c40d1.

This pull request removes 42 and adds 20 tests. Note that renamed tests count towards both.
tests.unit.aws.protocol.test_op_router ‑ test_create_op_router_works_for_every_service[privatenetworks]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-AddStorageSystem]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-DescribeDiscoveryJob]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-DescribeStorageSystemResourceMetrics]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-DescribeStorageSystemResources]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-DescribeStorageSystem]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-GenerateRecommendations]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-ListDiscoveryJobs]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-ListStorageSystems]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[datasync-json-RemoveStorageSystem]
…
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-create_delegate_mac_volume_ownership_task]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-create_mac_system_integrity_protection_modification_task]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-describe_mac_modification_tasks]
tests.unit.aws.api.test_asf_providers ‑ test_provider_signatures[Ec2Provider-Ec2Api-modify_public_ip_dns_name_options]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[amp-rest-json-CreateQueryLoggingConfiguration]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[amp-rest-json-DeleteQueryLoggingConfiguration]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[amp-rest-json-DescribeQueryLoggingConfiguration]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[amp-rest-json-UpdateQueryLoggingConfiguration]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[bedrock-agent-runtime-rest-json-GetExecutionFlowSnapshot]
tests.unit.aws.test_service_router ‑ test_service_router_works_for_every_service[bedrock-agent-runtime-rest-json-GetFlowExecution]
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 20, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   20m 42s ⏱️ - 1h 21m 27s
505 tests  - 3 958  316 ✅  - 3 758  189 💤  - 200  0 ❌ ±0 
507 runs   - 3 958  316 ✅  - 3 758  191 💤  - 200  0 ❌ ±0 

Results for commit 2e175d8. ± Comparison against base commit 20c40d1.

This pull request removes 3968 and adds 10 tests. Note that renamed tests count towards both.
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]
…
tests.aws.services.cloudformation.resources.test_sns ‑ test_sns_subscription_region
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter_ref
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_string_pseudo
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_delete_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_delete_string_pseudo
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_parameter_type
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_string_pseudo
This pull request removes 209 skipped tests and adds 9 skipped tests. Note that renamed tests count towards both.
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input4-FAILED]
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_deployed_infra_state
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_populate_data
tests.aws.scenario.mythical_mysfits.test_mythical_misfits.TestMythicalMisfitsScenario ‑ test_user_clicks_are_stored
tests.aws.services.apigateway.test_apigateway_api.TestApiGatewayApiRestApi ‑ test_get_api_case_insensitive
tests.aws.services.apigateway.test_apigateway_api.TestApigatewayIntegration ‑ test_put_integration_request_parameter_bool_type
tests.aws.services.apigateway.test_apigateway_basic.TestAPIGateway ‑ test_api_gateway_authorizer_crud
tests.aws.services.apigateway.test_apigateway_basic.TestAPIGateway ‑ test_api_gateway_http_integration_with_path_request_parameter
tests.aws.services.apigateway.test_apigateway_basic.TestAPIGateway ‑ test_api_gateway_lambda_proxy_integration[/lambda/foo1]
…
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_parameter_ref
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_addition_string_pseudo
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_delete_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_delete_string_pseudo
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_parameter_literal
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_parameter_type
tests.aws.services.cloudformation.v2.test_change_set_fn_sub.TestChangeSetFnSub ‑ test_fn_sub_update_string_pseudo

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 20, 2025

Test Results (amd64) - Acceptance

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

Results for commit 2e175d8. ± Comparison against base commit 20c40d1.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 20, 2025

Test Results - Alternative Providers

606 tests  +9   429 ✅ +10   15m 18s ⏱️ +28s
  4 suites ±0   177 💤  -  1 
  4 files   ±0     0 ❌ ± 0 

Results for commit 2e175d8. ± Comparison against base commit 20c40d1.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 20, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ± 0      5 suites  ±0   2h 20m 7s ⏱️ - 2m 3s
4 833 tests +15  4 282 ✅ +6  551 💤 +9  0 ❌ ±0 
4 839 runs  +15  4 282 ✅ +6  557 💤 +9  0 ❌ ±0 

Results for commit 2e175d8. ± Comparison against base commit 20c40d1.

This pull request skips 1 and un-skips 1 tests.
tests.aws.services.lambda_.event_source_mapping.test_lambda_integration_sqs.TestSQSEventSourceMapping ‑ test_sqs_event_source_mapping_batch_size_override[10000]
tests.aws.services.dynamodb.test_dynamodb.TestDynamoDB ‑ test_streams_on_global_tables

♻️ 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.

Looks great, thanks!

template_variable_value = sub_parameters[template_variable_name]
else:
try:
resource_delta = self._resolve_reference(logical_id=template_variable_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: references are not always for resources

Suggested change
resource_delta = self._resolve_reference(logical_id=template_variable_name)
reference_delta = self._resolve_reference(logical_id=template_variable_name)

@MEPalma MEPalma merged commit e42e683 into master Jun 2, 2025
57 checks passed
@MEPalma MEPalma deleted the MEP-CFN-fn_sub branch June 2, 2025 08:15
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