Skip to content

Conversation

@simonrw
Copy link
Contributor

@simonrw simonrw commented Oct 7, 2025

Motivation

While triaging issues, we found that the error

    for resource_id, resource in template[""Resources""].items():
                                 ~~~~~~~~^^^^^^^^^^^^^
localstack.aws.api.core.CommonServiceException: exception while calling cloudformation.GetTemplateSummary: 'NoneType' object is not subscriptable

was encountered and shown to be quite common. This occurs because we do not correctly set the change set template on the stack if the stack fails to deploy.

Changes

  • Raise validation error for get_template_summary if the template body does not include the Resources field (discovered as a separate bug while investigating the real bug)
  • Handle not setting template after execute_change_set

@simonrw simonrw added aws:cloudformation AWS CloudFormation semver: patch Non-breaking changes which can be included in patch releases 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 7, 2025
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Test Results - Preflight, Unit

22 292 tests  ±0   20 549 ✅ ±0   15m 47s ⏱️ +8s
     1 suites ±0    1 743 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 90ddbfe. ± Comparison against base commit b592fbd.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Test Results (amd64) - Acceptance

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

Results for commit 90ddbfe. ± Comparison against base commit b592fbd.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   35m 24s ⏱️ - 1h 25m 23s
578 tests  - 4 224  463 ✅  - 4 001  115 💤  - 223  0 ❌ ±0 
580 runs   - 4 224  463 ✅  - 4 001  117 💤  - 223  0 ❌ ±0 

Results for commit 90ddbfe. ± Comparison against base commit b592fbd.

This pull request removes 4226 and adds 2 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.api.test_templates ‑ test_get_template_summary_failed_stack
tests.aws.services.cloudformation.api.test_templates ‑ test_get_template_summary_no_resources

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   48m 18s ⏱️
602 tests 488 ✅ 114 💤 0 ❌
608 runs  488 ✅ 120 💤 0 ❌

Results for commit 90ddbfe.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Test Results - Alternative Providers

577 tests   330 ✅  25m 59s ⏱️
  1 suites  247 💤
  1 files      0 ❌

Results for commit 90ddbfe.

@simonrw simonrw marked this pull request as ready for review October 8, 2025 08:45
Copy link
Member

@pinzon pinzon left a comment

Choose a reason for hiding this comment

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

LGTM. It's great that you added more than just one validation test 👍

@simonrw simonrw merged commit c2e408c into main Oct 8, 2025
60 checks passed
@simonrw simonrw deleted the cfn/get-template-summary-failed-stack branch October 8, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:cloudformation AWS CloudFormation 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