Skip to content

Conversation

@pinzon
Copy link
Member

@pinzon pinzon commented Oct 17, 2025

Motivation

A special case in the CloudFormation service is the ability of Custom Resources to self-modify via their outputs. For instance, if a custom resource has a property called Value and its output also includes a property called Value, the GetAtt function should resolve to the computed value.

This PR modifies the engine to first check the resource’s resulting model from the provider, and only then fall back to the template. This ensures that if a custom resource updates its own state, the template engine can retrieve the new value, while still using the original template value as a fallback when needed.

Changes

  • Reordering of property search.

Testing

  • Since the test requires Custom Resources, it's done in another PR.

@pinzon pinzon added semver: patch Non-breaking changes which can be included in patch releases aws:cloudformation:v2 Issues related to the V2 CloudFormation engine docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Oct 17, 2025
@github-actions
Copy link

github-actions bot commented Oct 17, 2025

Test Results - Preflight, Unit

22 366 tests  ±0   20 616 ✅ ±0   15m 24s ⏱️ -19s
     1 suites ±0    1 750 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 6620515. ± Comparison against base commit aba1ee8.

♻️ This comment has been updated with latest results.

@pinzon pinzon changed the title CFnV2: GetAtt looks first into resource results CFnV2: GetAtt function searches first into resource results Oct 17, 2025
@github-actions
Copy link

github-actions bot commented Oct 17, 2025

Test Results (amd64) - Acceptance

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

Results for commit 6620515. ± Comparison against base commit aba1ee8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

Test Results - Alternative Providers

584 tests   330 ✅  25m 54s ⏱️
  1 suites  254 💤
  1 files      0 ❌

Results for commit 6620515.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   49m 16s ⏱️
609 tests 496 ✅ 113 💤 0 ❌
615 runs  496 ✅ 119 💤 0 ❌

Results for commit 6620515.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   36m 54s ⏱️ - 1h 21m 55s
585 tests  - 4 293  471 ✅  - 4 052  114 💤  - 241  0 ❌ ±0 
587 runs   - 4 293  471 ✅  - 4 052  116 💤  - 241  0 ❌ ±0 

Results for commit 6620515. ± Comparison against base commit aba1ee8.

This pull request removes 4293 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 unc-12-document-controller-configuration branch from f93e89d to fef2a9b Compare October 20, 2025 14:07
@pinzon pinzon force-pushed the unc-12-document-controller-configuration branch from fef2a9b to 4656c18 Compare October 21, 2025 13:47
@pinzon pinzon marked this pull request as ready for review October 21, 2025 17:47
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, just a minor suggestion on coding style

resource_logical_id=logical_name_of_resource,
property_name=attribute_name,
)

Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: perhaps consider an early return here - I think it is clearer to return the value found and not continue with the rest of the function implementation.

@pinzon pinzon merged commit c72f230 into main Oct 23, 2025
43 checks passed
@pinzon pinzon deleted the unc-12-document-controller-configuration branch October 23, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:cloudformation:v2 Issues related to the V2 CloudFormation engine 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

Development

Successfully merging this pull request may close these issues.

3 participants