@go-to-k/cdkd 0.24.0 → 0.25.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
@@ -502,6 +502,40 @@ cdkd deploy --no-wait
502
502
 
503
503
  This can significantly speed up deployments with CloudFront (which takes 3-15 minutes to deploy to edge locations). The resource is fully functional once AWS finishes the async deployment.
504
504
 
505
+ ## Per-resource timeout
506
+
507
+ Both `cdkd deploy` and `cdkd destroy` (including `cdkd state destroy`) enforce a wall-clock deadline on every individual CREATE / UPDATE / DELETE so a stuck Cloud Control polling loop, hung Custom Resource handler, or slow ENI release cannot block the run forever.
508
+
509
+ | Option | Default | Description |
510
+ | --- | --- | --- |
511
+ | `--resource-warn-after <duration>` | `5m` | Warn when a single resource operation has been running longer than this. The live progress line is suffixed with `[taking longer than expected, Nm+]` and a `WARN` log line is emitted (printed above the live area in TTY mode, plain stderr otherwise). |
512
+ | `--resource-timeout <duration>` | `30m` | Abort a single resource operation that exceeds this. The deploy / destroy fails with `ResourceTimeoutError` (wrapped in `ProvisioningError`) and the existing rollback / state-preservation path runs. |
513
+
514
+ Durations are written as `<number>s`, `<number>m`, or `<number>h` (e.g. `30s`, `90s`, `5m`, `1.5h`). Zero, negative, missing-unit, and unknown-unit values are rejected at parse time.
515
+
516
+ ```bash
517
+ # Bump the per-resource budget to one hour (matches the Custom Resource provider's polling cap)
518
+ cdkd deploy --resource-timeout 1h
519
+
520
+ # Surface "still running" warnings sooner on a fast-feedback dev loop
521
+ cdkd deploy --resource-warn-after 90s --resource-timeout 10m
522
+ ```
523
+
524
+ ### Why the default is 30m, not 1h
525
+
526
+ cdkd's Custom Resource provider polls async handlers (`isCompleteHandler` pattern) for up to one hour before giving up. Setting the per-resource timeout to 1h by default would make a single hung Custom Resource hold the whole stack for an hour even though no other resource type ever needs more than a few minutes. A shorter default (`30m`) catches stuck operations faster, and stacks that legitimately rely on long-running Custom Resources opt into the higher budget explicitly with `--resource-timeout 1h`.
527
+
528
+ The error message on timeout names the resource, type, region, elapsed time, and operation, and reminds you to re-run with `--resource-timeout 1h` (or higher) for genuinely-long resources:
529
+
530
+ ```text
531
+ Resource MyBucket (AWS::S3::Bucket) in us-east-1 timed out after 30m during CREATE (elapsed 30m).
532
+ This may indicate a stuck Cloud Control polling loop, hung Custom Resource, or
533
+ slow ENI provisioning. Re-run with --resource-timeout 1h if the resource genuinely
534
+ needs more time, or --verbose to see the underlying provider activity.
535
+ ```
536
+
537
+ Note: `--resource-warn-after` must be less than `--resource-timeout`. Reversed values are rejected at parse time.
538
+
505
539
  ## Example
506
540
 
507
541
  ```typescript