8000 CFn v2: implement support for CDK bootstrap by simonrw · Pull Request #12731 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

CFn v2: implement support for CDK bootstrap #12731

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 1 commit into from
Jun 9, 2025

Conversation

simonrw
Copy link
Contributor
@simonrw simonrw commented Jun 9, 2025

Motivation

Currently CDK bootstrap fails for a variety of reasons. Without this, users who use CDK cannot test their applications with our new engine.

Changes

  • Handle dynamic parameter lookup of SSM parameters
  • Set resource status on success/failure of a deployment
  • Handle the case where an Fn::Join is called without a list as a second argument, in the special case of an empty string, e.g. Fn::Join: ["", ""] as the CDK does this
  • Add helper find_stack_v2 function for finding v2 stacks
  • Implement describe_stack_resources to support our CDK bootstrap tests
  • Update the cdk bootstrap test skip reason as our lack of deletion
    causes test failures

Testing

I have not added any integration tests for this since its functionality is covered by our existing TestCdkInit.test_cdk_bootstrap (parametrized) tests. Unfortunately since we don't support deletions yet (see #12576), the tests fail when run together. Each test individually passes, so I've updated the skip reason to reflect the updated nature of the failure.

To test manually, unskip the tests, and run

pytest tests/aws/services/cloudformation/v2/ported_from_v1/resources/test_cdk.py::TestCdkInit::test_cdk_bootstrap[10]

## Motivation

Currently CDK bootstrap fails for a variety of reasons. Without this,
users who use CDK cannot test their applications with our new engine.

## Changes

* Handle dynamic parameter lookup of SSM parameters
* Set resource status on success/failure of a deployment
* Handle the case where an Fn::Join is called without a list as a second argument, in the special case of an empty string, e.g. `Fn::Join: ["", ""] as the CDK does this
* Add helper `find_stack_v2` function for finding v2 stacks
* Implement `describe_stack_resources` to support our CDK bootstrap tests
* Update the cdk bootstrap test skip reason as our lack of deletion
  causes test failures

## Testing

I have not added any integration tests for this since its functionality
is covered by our existing `TestCdkInit.test_cdk_bootstrap`
(parametrized) tests.
Unfortunately since we don't support deletions yet (see
#12576), the tests fail
when run together. Each test individually passes, so I've updated the
skip reason to reflect the updated nature of the failure.

To test manually, unskip the tests, and run

```
pytest tests/aws/services/cloudformation/v2/ported_from_v1/resources/test_cdk.py::TestCdkInit::test_cdk_bootstrap[10]
```
@simonrw simonrw added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Jun 9, 2025
@simonrw simonrw changed the title Implement support for CDK Bootstrap stacks CFn v2: implement support for CDK bootstrap Jun 9, 2025
Copy link
github-actions bot commented Jun 9, 2025

Test Results - Preflight, Unit

21 595 tests  ±0   19 940 ✅ ±0   6m 46s ⏱️ +28s
     1 suites ±0    1 655 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit cc92e8e. ± Comparison against base commit 3adead2.

Copy link
github-actions bot commented Jun 9, 2025

Test Results (amd64) - Acceptance

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

Results for commit cc92e8e. ± Comparison against base commit 3adead2.

Copy link
github-actions bot commented Jun 9, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   21m 35s ⏱️ - 1h 22m 18s
885 tests  - 3 987  319 ✅  - 3 776  566 💤  - 211  0 ❌ ±0 
887 runs   - 3 987  319 ✅  - 3 776  568 💤  - 211  0 ❌ ±0 

Results for commit cc92e8e. ± Comparison against base commit 3adead2.

This pull request removes 3987 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]
…

Copy link
github-actions bot commented Jun 9, 2025

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   33m 16s ⏱️
909 tests 344 ✅ 565 💤 0 ❌
915 runs  344 ✅ 571 💤 0 ❌

Results for commit cc92e8e.

Copy link
github-actions bot commented Jun 9, 2025

Test Results - Alternative Providers

987 tests   584 ✅  23m 17s ⏱️
  4 suites  403 💤
  4 files      0 ❌

Results for commit cc92e8e.

@simonrw simonrw marked this pull request as ready for review June 9, 2025 14:20
@simonrw simonrw requested a review from MEPalma June 9, 2025 14:20
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

@simonrw simonrw merged commit 05db0f1 into master Jun 9, 2025
65 checks passed
@simonrw simonrw deleted the cfn/v2/enable-cdk-bootstrap branch June 9, 2025 20:14
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
0