@go-to-k/cdkd 0.149.0 → 0.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -585,21 +585,31 @@ The Custom Resource Lambda must be idempotent AND must POST to
585
585
  `event.ResponseURL` per the cfn-response protocol. Without the flag,
586
586
  the command refuses to proceed and the user is expected to destroy
587
587
  the offending resources (or accept abandoning them) first. Nested
588
- `AWS::CloudFormation::Stack` rows have partial support as of
589
- [#464](https://github.com/go-to-k/cdkd/issues/464) PR B1: `cdkd export`
588
+ `AWS::CloudFormation::Stack` rows are fully supported as of
589
+ [#464](https://github.com/go-to-k/cdkd/issues/464) PR B2: `cdkd export`
590
590
  recursively walks the cdkd state tree, validates every parent → child
591
- link, and surfaces the full leaf-first migration scope to the user;
592
- the CFn-side per-stack IMPORT loop submission itself is deferred to
593
- PR B2 (the original "one atomic `--include-nested-stacks` IMPORT
594
- changeset" design was found infeasible by the 2026-05-24 AWS spike
595
- AWS rejects that flag combination with
591
+ link, and submits **IMPORT changesets per cdkd-managed stack** in
592
+ leaf-first order leaf stacks via one CREATE-via-IMPORT changeset, non-leaf
593
+ parents via two changesets (Phase 1A CREATE-via-IMPORT for the parent's
594
+ leaf resources only, then Phase 1B UPDATE-via-IMPORT for the just-imported
595
+ child adoption per AWS's
596
+ ["Nest an existing stack"](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-nested-stacks.html)
597
+ pattern with `DeletionPolicy: Retain` plus
598
+ `ResourceIdentifier: { StackId: <child arn> }` plus AWS-validated
599
+ child-Tag forwarding). Between phases cdkd flips each
600
+ stack's status from `IMPORT_COMPLETE` to `UPDATE_COMPLETE` via a no-op
601
+ tag-only `UpdateStack` (AWS rejects `IMPORT_COMPLETE` as a non-importable
602
+ status for nested adoption). The original "one atomic
603
+ `--include-nested-stacks` IMPORT changeset" design was found infeasible
604
+ by the 2026-05-24 AWS spike — AWS rejects that flag combination with
596
605
  `ValidationError: IncludeNestedStacks is not supported for changeSet type: IMPORT`;
597
606
  see [docs/design/464-nested-stacks-export-import.md](docs/design/464-nested-stacks-export-import.md)
598
- §4.0), so the command warns on `--dry-run` / hard-errors on real run
599
- with a clear pointer + workaround (keep on cdkd, or destroy children
600
- leaf-first via `cdkd state destroy <child>` and re-export the
601
- flattened parent). Fresh `cdkd deploy` of nested
602
- stacks works via [#459](https://github.com/go-to-k/cdkd/issues/459).
607
+ §4.0 / §4.3 for the per-stack-loop algorithm. Each child cdkd stack
608
+ (`<parent>~<childLogicalId>`) becomes its own CFn stack named
609
+ `<parent>-<childLogicalId>` by default (`~` is illegal in CFn stack
610
+ names); override per child with `--cfn-child-stack-name '<cdkd>=<cfn>'`
611
+ (repeatable). Fresh `cdkd deploy` of nested stacks works via
612
+ [#459](https://github.com/go-to-k/cdkd/issues/459).
603
613
 
604
614
  ```bash
605
615
  cdkd export MyStack # confirmation prompt; CFn stack name = cdkd stack name
@@ -607,6 +617,10 @@ cdkd export MyStack --cfn-stack-name MyStack-CFn
607
617
  cdkd export MyStack --dry-run # print the import plan, do not call CFn
608
618
  cdkd export MyStack --template path.json # skip synth, use a pre-rendered template (JSON or YAML — format auto-detected)
609
619
  cdkd export MyStack --include-non-importable # 2-phase: IMPORT importable + CFn-CREATE Custom Resources
620
+
621
+ # Nested-stack tree (parent + children). Default child CFn names: '<parent>-<childLogicalId>'.
622
+ cdkd export MyApp # leaf-first per-stack IMPORT loop
623
+ cdkd export MyApp --cfn-child-stack-name 'MyApp~Database=my-app-db' # per-child name override
610
624
  ```
611
625
 
612
626
  Accepts JSON and YAML templates. YAML round-trips through a CFn-aware codec