@go-to-k/cdkd 0.17.1 → 0.18.1
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 +68 -14
- package/dist/cli.js +461 -209
- package/dist/cli.js.map +4 -4
- package/dist/go-to-k-cdkd-0.18.1.tgz +0 -0
- package/dist/index.js +158 -118
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/go-to-k-cdkd-0.17.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -458,10 +458,16 @@ cdkd state resources MyStack --json # full JSON array
|
|
|
458
458
|
cdkd state show MyStack
|
|
459
459
|
cdkd state show MyStack --json # raw {state, lock} JSON
|
|
460
460
|
|
|
461
|
-
#
|
|
462
|
-
|
|
463
|
-
cdkd
|
|
464
|
-
cdkd
|
|
461
|
+
# Orphan a stack from cdkd's state (does NOT delete AWS resources).
|
|
462
|
+
# Synth-driven — needs --app / cdk.json — same stack-pattern routing as deploy.
|
|
463
|
+
cdkd orphan MyStack # confirmation prompt (y/N)
|
|
464
|
+
cdkd orphan MyStack --yes
|
|
465
|
+
cdkd orphan 'MyStage/*' --yes # display-path wildcard
|
|
466
|
+
|
|
467
|
+
# State-driven counterpart (no CDK app needed — works against the bucket).
|
|
468
|
+
cdkd state orphan MyStack # confirmation prompt (y/N)
|
|
469
|
+
cdkd state orphan MyStack --yes # skip confirmation
|
|
470
|
+
cdkd state orphan StackA StackB --force # also bypass the locked-stack refusal
|
|
465
471
|
|
|
466
472
|
# Destroy a stack's AWS resources AND remove its state record, without
|
|
467
473
|
# requiring the CDK app (no synth — works from any working directory).
|
|
@@ -471,10 +477,12 @@ cdkd state destroy --all -y # every stack in the bucket
|
|
|
471
477
|
cdkd state destroy MyStack --region us-east-1
|
|
472
478
|
```
|
|
473
479
|
|
|
474
|
-
>
|
|
475
|
-
> AWS resources
|
|
476
|
-
> the
|
|
477
|
-
>
|
|
480
|
+
> **`destroy` vs `orphan`** (matches aws-cdk-cli's new `cdk orphan`):
|
|
481
|
+
> `destroy` deletes the AWS resources AND the state record. `orphan` deletes
|
|
482
|
+
> ONLY the state record — AWS resources remain intact, just no longer
|
|
483
|
+
> tracked by cdkd. Each has a synth-driven form (`cdkd destroy` / `cdkd
|
|
484
|
+
> orphan`, needs the CDK app) and a state-driven form (`cdkd state destroy`
|
|
485
|
+
> / `cdkd state orphan`, works on the bucket alone).
|
|
478
486
|
|
|
479
487
|
### Concurrency Options
|
|
480
488
|
|
|
@@ -561,14 +569,60 @@ s3://{state-bucket}/
|
|
|
561
569
|
> `env.region` between deploys silently overwrote the prior region's state
|
|
562
570
|
> and `cdkd destroy` ran against the wrong region. cdkd now treats the two
|
|
563
571
|
> regions as independent. Use `cdkd state list` to see both, and
|
|
564
|
-
> `cdkd state
|
|
572
|
+
> `cdkd state orphan <stack> --stack-region <region>` to prune one without
|
|
565
573
|
> touching the other.
|
|
566
574
|
>
|
|
567
|
-
> **Legacy layout migration
|
|
568
|
-
> layout (`version: 1`, flat
|
|
569
|
-
> readable. The next cdkd write
|
|
570
|
-
>
|
|
571
|
-
>
|
|
575
|
+
> **Legacy key-layout migration (within the same bucket):** state files
|
|
576
|
+
> written by cdkd before this layout (`version: 1`, flat
|
|
577
|
+
> `cdkd/{stackName}/state.json`) are still readable. The next cdkd write
|
|
578
|
+
> auto-migrates to the new region-prefixed key
|
|
579
|
+
> (`cdkd/{stackName}/{region}/state.json`) and removes the legacy file —
|
|
580
|
+
> no manual action required. An older cdkd binary reading a `version: 2`
|
|
581
|
+
> file fails with a clear "upgrade cdkd" error rather than silently
|
|
582
|
+
> mishandling it.
|
|
583
|
+
>
|
|
584
|
+
> Note: this only covers the **key layout inside an existing state
|
|
585
|
+
> bucket**. The separate **bucket-name migration** (legacy
|
|
586
|
+
> `cdkd-state-{accountId}-{region}` → new `cdkd-state-{accountId}`)
|
|
587
|
+
> is described below and does NOT auto-migrate.
|
|
588
|
+
|
|
589
|
+
### Bucket migration
|
|
590
|
+
|
|
591
|
+
The default state-bucket name changed in v0.11.0 from the region-suffixed
|
|
592
|
+
`cdkd-state-{accountId}-{region}` to the region-free
|
|
593
|
+
`cdkd-state-{accountId}`. The bucket name is region-free because S3 names
|
|
594
|
+
are globally unique, so teammates with different profile regions all
|
|
595
|
+
converge on the same bucket; the bucket's actual region is auto-detected
|
|
596
|
+
via `GetBucketLocation`.
|
|
597
|
+
|
|
598
|
+
Existing users keep working without doing anything: when only the legacy
|
|
599
|
+
bucket exists, cdkd transparently falls back to it and emits a
|
|
600
|
+
deprecation warning. To stop the warning (and consolidate state into the
|
|
601
|
+
new bucket) run:
|
|
602
|
+
|
|
603
|
+
```bash
|
|
604
|
+
# Per-region: copies all objects from cdkd-state-{accountId}-{region}
|
|
605
|
+
# into cdkd-state-{accountId}. Source bucket is kept by default.
|
|
606
|
+
cdkd state migrate --region us-east-1
|
|
607
|
+
|
|
608
|
+
# Optional: delete the legacy bucket once the copy is verified.
|
|
609
|
+
cdkd state migrate --region us-east-1 --remove-legacy
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
This migration is **account-wide / per-region**, not per-stack — running
|
|
613
|
+
it once per region clears the legacy bucket for that region in one shot.
|
|
614
|
+
For multi-region accounts, run it once per region (each invocation copies
|
|
615
|
+
into the same destination bucket).
|
|
616
|
+
|
|
617
|
+
`cdkd state migrate` refuses to run while any stack has an active
|
|
618
|
+
`lock.json` (an in-flight `cdkd deploy` / `destroy` would race the copy),
|
|
619
|
+
verifies object-count parity between source and destination before any
|
|
620
|
+
source cleanup, and only deletes the legacy bucket when
|
|
621
|
+
`--remove-legacy` is passed.
|
|
622
|
+
|
|
623
|
+
See the [Configuration](#configuration) table below for the full
|
|
624
|
+
precedence rules of the `--state-bucket` flag and its env-var / cdk.json
|
|
625
|
+
fallbacks.
|
|
572
626
|
|
|
573
627
|
### Configuration
|
|
574
628
|
|