Skip to content

Conversation

@pinzon
Copy link
Member

@pinzon pinzon commented Oct 9, 2025

Motivation

This PR adds validation to prevent stack updates when a stack is already deleted or in the process of being deleted (e.g., during deletion). This addresses an issue where users encountered Programming error: duplicate stacks found. I was able to reproduce it with this process:

  1. Created and then deleted a stack
  2. Created a new stack with the same name as before
  3. Attempted to create a changeset for the original (now-deleted) stack using its ID
  4. Called DescribeStacks, which failed because two active stacks existed with the same name

The root cause was that step 3 didn't properly validate if the found was deleted, leaving both the new stack and the original active in the Cloudformation.

Changes

  • Validate Stack status if creating a change set or updating a stack.

Testing

  • Validated tests for create_change_set and update_stack

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Test Results - Preflight, Unit

22 298 tests  ±0   20 555 ✅ ±0   15m 38s ⏱️ -43s
     1 suites ±0    1 743 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit c7d27b1. ± Comparison against base commit 69ed784.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   36m 9s ⏱️ - 1h 25m 26s
585 tests  - 4 230  471 ✅  - 4 007  114 💤  - 223  0 ❌ ±0 
587 runs   - 4 230  471 ✅  - 4 007  116 💤  - 223  0 ❌ ±0 

Results for commit c7d27b1. ± Comparison against base commit 69ed784.

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

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Test Results (amd64) - Acceptance

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

Results for commit c7d27b1. ± Comparison against base commit 69ed784.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Test Results (amd64) - Integration, Bootstrap

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

Results for commit c7d27b1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Test Results - Alternative Providers

584 tests   330 ✅  26m 5s ⏱️
  1 suites  254 💤
  1 files      0 ❌

Results for commit c7d27b1.

♻️ This comment has been updated with latest results.

@pinzon pinzon force-pushed the unc-43-duplicate-stacks-found branch from 6ff9e82 to 675a662 Compare October 10, 2025 18:09
@pinzon pinzon marked this pull request as ready for review October 11, 2025 01:22
@pinzon pinzon added semver: patch Non-breaking changes which can be included in patch releases review: merge when ready Signals to the reviewer that a PR can be merged if accepted 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 11, 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 fixing this!

@pinzon pinzon merged commit 1324ae2 into main Oct 13, 2025
63 checks passed
@pinzon pinzon deleted the unc-43-duplicate-stacks-found branch October 13, 2025 19:56
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 review: merge when ready Signals to the reviewer that a PR can be merged if accepted 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