Skip to content

add support for Fn::Tranform in CFnV2 #12966

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

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

add support for Fn::Tranform in CFnV2 #12966

wants to merge 32 commits into from

Conversation

pinzon
Copy link
Member

@pinzon pinzon commented Aug 6, 2025

Motivation

This PR implements the capability to resolve FnTransform in the new CFnV2 engine in multiple locations of a template.

Changes

  • Add properties (parent, jsonpath) to Scope class
  • NodeResources and NodeProperties define a possible fn::transformation
  • New NodeIntrinsicFunctionFnTransform class to model a Fn::Transform
  • _visit_intrinsic_function can return a NodeIntrinsicFunctionFnTransform
  • Refactor _excute_macro and AWS::Include into transformer
  • Add events when a transformation fails
  • Add template body character limit assertion
  • Transformer adds some extra overrides due to missing resources during transformations

Testing

  • Removed skip_if_v2_provider in related tests

Notes

This PR only implements the resolution of the transformations in specific locations. More locations are going to be needed in the future

@pinzon pinzon added the semver: patch Non-breaking changes which can be included in patch releases label Aug 6, 2025
Copy link

github-actions bot commented Aug 6, 2025

Test Results - Preflight, Unit

22 107 tests  ±0   20 372 ✅ ±0   6m 20s ⏱️ -14s
     1 suites ±0    1 735 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 1b4f91b. ± Comparison against base commit 5a920cb.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

Test Results (amd64) - Acceptance

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

Results for commit 1b4f91b. ± Comparison against base commit 5a920cb.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ±0      5 suites  ±0   2h 20m 42s ⏱️ - 1m 10s
4 987 tests ±0  4 395 ✅ ±0  592 💤 ±0  0 ❌ ±0 
4 993 runs  ±0  4 395 ✅ ±0  598 💤 ±0  0 ❌ ±0 

Results for commit 1b4f91b. ± Comparison against base commit 5a920cb.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   21m 36s ⏱️ - 1h 23m 22s
555 tests  - 4 073  330 ✅  - 3 858  225 💤  - 215  0 ❌ ±0 
557 runs   - 4 073  330 ✅  - 3 858  227 💤  - 215  0 ❌ ±0 

Results for commit bab886a. ± Comparison against base commit 5a920cb.

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

@pinzon pinzon force-pushed the cp/cfn/v2/transform branch from a85bc97 to aae7310 Compare August 7, 2025 19:40
@pinzon pinzon force-pushed the cp/cfn/v2/transform branch 3 times, most recently from 8703ae2 to b22a894 Compare August 12, 2025 20:36
@pinzon pinzon requested a review from simonrw August 12, 2025 22:08
@pinzon pinzon force-pushed the cp/cfn/v2/transform branch from daa7743 to c962e2f Compare August 12, 2025 22:18
@pinzon pinzon marked this pull request as ready for review August 12, 2025 22:24
Comment on lines +307 to +314
except FailedTransformationException as e:
change_set.status = ChangeSetStatus.FAILED
change_set.status_reason = e.message
change_set.stack.set_stack_status(
status=StackStatus.ROLLBACK_IN_PROGRESS, reason=e.message
)
change_set.stack.set_stack_status(status=StackStatus.CREATE_FAILED)
return
Copy link
Member Author

Choose a reason for hiding this comment

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

@simonrw This is the section I'm not liking that much

@pinzon pinzon force-pushed the cp/cfn/v2/transform branch from e078fad to 3409251 Compare August 13, 2025 21:38
pinzon and others added 3 commits August 13, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants