@go-to-k/cdkd 0.75.2 → 0.77.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
@@ -1,19 +1,15 @@
1
1
  # cdkd
2
2
 
3
- **cdkd** (CDK Direct) - A from-scratch CDK CLI with its own deployment engine — provisions via AWS SDK instead of CloudFormation.
3
+ **cdkd** (CDK Direct) a from-scratch CDK CLI that provisions via AWS SDK instead of CloudFormation.
4
4
 
5
- - **Direct provisioning** via AWS SDK instead of CloudFormation
6
- - **From-scratch CDK CLI** - synthesis orchestration, asset publishing, context resolution (no aws-cdk / toolkit-lib dependency)
7
- - **CDK compatible** - use your existing CDK app code as-is
8
- - **Own deployment engine** - diff calculation, dependency graph, parallel execution, state management (what CloudFormation handles internally)
5
+ - **Drop-in CDK compatible** your existing CDK app code runs as-is.
6
+ - **Up to 15x faster deploys than the AWS CDK CLI (CloudFormation)**
9
7
 
10
8
  ![cdkd demo](https://github.com/user-attachments/assets/0128730d-186d-4bd3-abea-aabc80ba4dd5)
11
9
 
12
10
  > **⚠️ WARNING: NOT PRODUCTION READY**
13
11
  >
14
- > This project is in early development and is **NOT suitable for production use**. Features are incomplete, APIs may change without notice, and there may be bugs that could affect your AWS infrastructure. Use at your own risk in development/testing environments only.
15
-
16
- > **Note**: This is an experimental/educational project exploring alternative deployment approaches for AWS CDK. It is **not intended to replace** the official AWS CDK CLI, but rather to experiment with direct SDK provisioning as a learning exercise and proof of concept.
12
+ > An experimental project exploring direct SDK provisioning as an alternative to the AWS CDK CLI — **NOT a replacement** and **NOT suitable for production use**. Features are incomplete, APIs may change without notice, and bugs may affect your AWS infrastructure. Use at your own risk in development / testing environments only.
17
13
 
18
14
  ## Features
19
15
 
@@ -32,31 +28,37 @@
32
28
 
33
29
  ## Benchmark
34
30
 
35
- **cdkd deploys up to ~5x faster than AWS CDK (CloudFormation).**
31
+ **cdkd deploys up to 15x faster than AWS CDK (CloudFormation)** on SDK-Provider-handled stacks; the per-stack speedup widens with size and parallelism, and drops to ~1.5-3x on stacks dominated by Cloud Control API fallback resources.
32
+
33
+ Numbers below are deploy-phase only (CDK app synthesis is identical between cdkd and AWS CDK — both run the same user code through `aws-cdk-lib`'s synthesizer — so synth time is excluded from the speedup calculation).
34
+
35
+ ### SDK Provider path — **5.5x faster** (17.0s vs 94.4s)
36
36
 
37
- Measured on `us-east-1` with 5 independent resources per stack (fully parallelized by cdkd's DAG scheduler).
37
+ Stack: S3 Bucket, DynamoDB Table, SQS Queue, SNS Topic, SSM Parameter (5 independent resources, fully parallelized by cdkd's DAG scheduler).
38
38
 
39
- ### SDK Provider path **4.8x faster** (20.5s vs 98.4s)
39
+ | | cdkd | AWS CDK (CFn) | Speedup |
40
+ | --- | ---: | ---: | ---: |
41
+ | Deploy | **17.0s** | **94.4s** | **5.5x** |
40
42
 
41
- Stack: S3 Bucket, DynamoDB Table, SQS Queue, SNS Topic, SSM Parameter.
43
+ ### VPC + CloudFront + Lambda stack **15x faster with `--no-wait`** (40s vs 599s)
42
44
 
43
- | Phase | cdkd | AWS CDK (CFn) | Speedup |
44
- | --- | --- | --- | --- |
45
- | Synthesis | 3.5s | 4.1s | 1.2x |
46
- | Deploy | 17.0s | 94.4s | **5.5x** |
47
- | **Total** | **20.5s** | **98.4s** | **4.8x** |
45
+ Real-world stack: 1 VPC (2 AZs, NAT Gateway, public + private subnets) + Lambda Function (with `VpcConfig`) + Lambda Function URL (AWS_IAM) + CloudFront Distribution (OAC, caching disabled) + SQS Queue + EventSourceMapping + Consumer Lambda.
48
46
 
49
- ### Cloud Control API fallback path **1.5x faster** (44.6s vs 69.1s)
47
+ | | AWS CDK (CFn) | cdkd | cdkd `--no-wait` |
48
+ | --- | ---: | ---: | ---: |
49
+ | Deploy | **599s** | 197s (3.0x) | **40s (15.0x)** |
50
+
51
+ The 15x figure requires `cdkd deploy --no-wait`, which returns as soon as each Create call returns and lets AWS finish CloudFront's ~5min propagation + NAT Gateway stabilization in the background. cdkd's default scheduler already parallelizes `CloudFront::Distribution` / `Lambda::Url` / VPC Lambda with NAT Gateway propagation (pass `--no-aggressive-vpc-parallel` to opt out); on this stack the default gives ~3x. `--no-wait` adds the rest of the gap by skipping the propagation waits entirely.
52
+
53
+ ### Cloud Control API fallback path — **1.6x faster** (40.9s vs 64.9s)
50
54
 
51
55
  Stack: SSM Document × 3 + Athena WorkGroup × 2 (no SDK provider — CC API fallback).
52
56
 
53
- | Phase | cdkd | AWS CDK (CFn) | Speedup |
54
- | --- | --- | --- | --- |
55
- | Synthesis | 3.7s | 4.2s | 1.1x |
56
- | Deploy | 40.9s | 64.9s | **1.6x** |
57
- | **Total** | **44.6s** | **69.1s** | **1.5x** |
57
+ | | cdkd | AWS CDK (CFn) | Speedup |
58
+ | --- | ---: | ---: | ---: |
59
+ | Deploy | **40.9s** | **64.9s** | **1.6x** |
58
60
 
59
- Reproduce with `./tests/benchmark/run-benchmark.sh all`. See [tests/benchmark/README.md](tests/benchmark/README.md) for details.
61
+ Reproduce the first two with `./tests/benchmark/run-benchmark.sh all`. See [tests/benchmark/README.md](tests/benchmark/README.md) for details.
60
62
 
61
63
  ## How it works
62
64
 
@@ -99,79 +101,13 @@ parsing → synthesis → asset publishing → per-stack deploy), see
99
101
 
100
102
  ## Supported Features
101
103
 
102
- ### Intrinsic Functions
103
-
104
- | Function | Status | Notes |
105
- |----------|--------|-------|
106
- | `Ref` | Supported | Resource physical IDs, Parameters, Pseudo parameters |
107
- | `Fn::GetAtt` | Supported | Resource attributes (ARN, DomainName, etc.) |
108
- | `Fn::Join` | ✅ Supported | String concatenation |
109
- | `Fn::Sub` | ✅ Supported | Template string substitution |
110
- | `Fn::Select` | ✅ Supported | Array index selection |
111
- | `Fn::Split` | ✅ Supported | String splitting |
112
- | `Fn::If` | ✅ Supported | Conditional values |
113
- | `Fn::Equals` | ✅ Supported | Equality comparison |
114
- | `Fn::And` | ✅ Supported | Logical AND (2-10 conditions) |
115
- | `Fn::Or` | ✅ Supported | Logical OR (2-10 conditions) |
116
- | `Fn::Not` | ✅ Supported | Logical NOT |
117
- | `Fn::ImportValue` | ✅ Supported | Cross-stack references via S3 state |
118
- | `Fn::GetStackOutput` | ✅ Supported (same-account) | Cross-stack / cross-region output reference via S3 state. Cross-account `RoleArn` is rejected with a clear error (not yet implemented). |
119
- | `Fn::FindInMap` | ✅ Supported | Mapping lookup |
120
- | `Fn::GetAZs` | ✅ Supported | Availability Zone list |
121
- | `Fn::Base64` | ✅ Supported | Base64 encoding |
122
- | `Fn::Cidr` | ✅ Supported | CIDR address block generation |
123
-
124
- ### Pseudo Parameters
125
-
126
- | Parameter | Status |
127
- |-----------|--------|
128
- | `AWS::Region` | ✅ |
129
- | `AWS::AccountId` | ✅ (via STS) |
130
- | `AWS::Partition` | ✅ |
131
- | `AWS::URLSuffix` | ✅ |
132
- | `AWS::NoValue` | ✅ |
133
- | `AWS::StackName` | ✅ |
134
- | `AWS::StackId` | ✅ |
135
-
136
- ### Resource Provisioning
137
-
138
- cdkd ships **90+ dedicated SDK Providers** (direct AWS SDK calls, no
139
- polling overhead) covering the most-used services — IAM, Lambda, S3,
140
- DynamoDB, EC2, RDS, ECS, API Gateway, CloudFront, Step Functions, EFS,
141
- KMS, Cognito, AppSync, and more. **Any other CloudFormation resource
142
- type** is handled via the Cloud Control API fallback (async polling).
143
- Resource types not supported by either path fail at deploy time with a
144
- clear error.
145
-
146
- See **[docs/supported-resources.md](docs/supported-resources.md)** for
147
- the full per-type table.
148
-
149
- ### Other Features
150
-
151
- | Feature | Status | Notes |
152
- |---------|--------|-------|
153
- | CloudFormation Parameters | ✅ | Default values, type coercion |
154
- | Conditions | ✅ | With logical operators |
155
- | Cross-stack references | ✅ | Via `Fn::ImportValue` + S3 state |
156
- | Cross-region references | ✅ (same-account) | Via `Fn::GetStackOutput` + S3 state. Cross-account `RoleArn` not yet implemented. |
157
- | JSON Patch updates | ✅ | RFC 6902, minimal patches |
158
- | Resource replacement detection | ✅ | 10+ resource types |
159
- | Dynamic References | ✅ | `{{resolve:secretsmanager:...}}`, `{{resolve:ssm:...}}` |
160
- | DELETE idempotency | ✅ | Not-found errors treated as success |
161
- | Asset publishing (S3) | ✅ | Lambda code packages |
162
- | Asset publishing (ECR) | ✅ | Self-implemented Docker image publishing |
163
- | Custom Resources (SNS-backed) | ✅ | SNS Topic ServiceToken + S3 response |
164
- | Custom Resources (CDK Provider) | ✅ | isCompleteHandler/onEventHandler async pattern detection |
165
- | Rollback | ✅ | Auto-rollback on mid-deploy failure (deletes already-completed resources to keep state consistent); `--no-rollback` skips for Terraform-style failed-state inspection. See [Rollback behavior](#rollback-behavior) below. |
166
- | DeletionPolicy: Retain | ✅ | Skip deletion for retained resources |
167
- | UpdateReplacePolicy: Retain | ✅ | Keep old resource on replacement |
168
- | Implicit delete dependencies | ✅ | VPC/IGW/EventBus/Subnet/RouteTable ordering |
169
- | Stack dependency resolution | ✅ | Auto-deploy dependency stacks, `-e` to skip |
170
- | Multi-stack parallel deploy | ✅ | Independent stacks deployed in parallel |
171
- | Attribute enrichment | ✅ | CloudFront OAI, DynamoDB StreamArn, API Gateway RootResourceId, Lambda FunctionUrl, Route53 HealthCheckId, ECR Repository Arn |
172
- | CC API null value stripping | ✅ | Removes null values before API calls |
173
- | Retry with HTTP status codes | ✅ | 429/503 + cause chain inspection |
174
- | Drift detection | ✅ | `cdkd drift` — state vs AWS reality, including console-side changes to keys you didn't template. See [Drift detection](#drift-detection) below. |
104
+ cdkd supports the standard CloudFormation surface — intrinsic functions,
105
+ pseudo parameters, parameters / conditions, cross-stack / cross-region
106
+ references, asset publishing, custom resources, and so on. See
107
+ **[docs/supported-features.md](docs/supported-features.md)** for the
108
+ full reference. For per-resource-type provisioning support (SDK Providers
109
+ vs Cloud Control API fallback), see
110
+ **[docs/supported-resources.md](docs/supported-resources.md)**.
175
111
 
176
112
  ## Prerequisites
177
113
 
@@ -188,8 +124,6 @@ npm i -g @go-to-k/cdkd@0.0.2 # pin to a specific version
188
124
 
189
125
  The installed binary is `cdkd`.
190
126
 
191
- > cdkd is an experimental / educational project and is not intended for production use — see the warning at the top of this README. Pin to a specific version if you need reproducible installs.
192
-
193
127
  ## Quick Start
194
128
 
195
129
  > **First-time setup**: cdkd requires a one-time `cdkd bootstrap` per AWS
@@ -564,17 +498,18 @@ Lambda Runtime Interface Emulator (RIE). Modeled on `sam local invoke`
564
498
  but reusing cdkd's synthesis / asset / construct-path plumbing — no
565
499
  `template.yaml` to maintain, no `cdk synth | sam ...` round-trip.
566
500
 
567
- Requires Docker. v1 supports Node.js and Python runtimes (`nodejs18.x` /
568
- `nodejs20.x` / `nodejs22.x` / `python3.11` / `python3.12` / `python3.13`);
569
- other runtimes follow in subsequent PRs.
501
+ Requires Docker. Supports Node.js, Python, and Ruby runtimes (`nodejs18.x` /
502
+ `nodejs20.x` / `nodejs22.x` / `nodejs24.x` / `python3.11` / `python3.12` /
503
+ `python3.13` / `python3.14` / `ruby3.2` / `ruby3.3`); other runtimes
504
+ (Java / .NET / Go / `provided.*`) are not yet supported.
570
505
 
571
- **Container Lambdas (PR 5 of #224)** — `lambda.DockerImageFunction(...)` /
506
+ **Container Lambdas** — `lambda.DockerImageFunction(...)` /
572
507
  `Code.ImageUri` is supported alongside ZIP Lambdas. cdkd reads the
573
508
  function's local `Dockerfile` from `cdk.out` and runs `docker build`
574
509
  locally before invoking. When no asset matches (typically: invoking a
575
510
  stack deployed elsewhere), cdkd falls back to `docker pull` from
576
511
  ECR — same-account / same-region only in v1; cross-account /
577
- cross-region is deferred to a follow-up PR. `Architectures: [x86_64]` /
512
+ cross-region is not yet supported. `Architectures: [x86_64]` /
578
513
  `[arm64]` are honored via `--platform` so an arm64 host running an
579
514
  x86_64 Lambda doesn't hit emulation.
580
515
 
@@ -615,7 +550,7 @@ cdkd local invoke MyStack/Handler --debug-port 9229
615
550
  cdkd local invoke MyStack/Handler --from-state
616
551
  ```
617
552
 
618
- **Lambda Layers (PR 6 of #224, issue #232)** — same-stack
553
+ **Lambda Layers** — same-stack
619
554
  `AWS::Lambda::LayerVersion` references in `Properties.Layers` are
620
555
  resolved automatically and bind-mounted at `/opt` (read-only) inside
621
556
  the container. Each layer's unzipped asset directory under `cdk.out/`
@@ -663,12 +598,11 @@ cdkd local start-api --stage prod
663
598
  ```
664
599
 
665
600
  Scope: REST v1 + HTTP API + Function URL with AWS_PROXY integrations.
666
- Authorizers (PR 8b — Lambda TOKEN/REQUEST + Cognito User Pool + HTTP v2
667
- JWT), VPC-config Lambda warnings (PR 8b), CORS preflight (PR 8c), hot
668
- reload (PR 8c), and stage variables (PR 8c) are supported. WebSocket
669
- APIs are deferred to a follow-up PR.
601
+ Authorizers (Lambda TOKEN/REQUEST + Cognito User Pool + HTTP v2 JWT),
602
+ VPC-config Lambda warnings, CORS preflight, hot reload, and stage
603
+ variables are supported. WebSocket APIs are not.
670
604
 
671
- **Authorizers (PR 8b)**: `Authorization: Bearer <token>`-protected
605
+ **Authorizers**: `Authorization: Bearer <token>`-protected
672
606
  routes are gated on the authorizer Lambda's response (TOKEN / REQUEST
673
607
  authorizers, IAM-policy or HTTP v2 simple shape) or on a JWKS-based JWT
674
608
  verification (Cognito User Pool authorizers, HTTP v2 JWT authorizers).
@@ -677,7 +611,7 @@ back to **pass-through mode** (every JWT accepted, with a warn line at
677
611
  startup) — local-dev-only fallback so a corporate proxy doesn't block
678
612
  iteration. **Do NOT rely on this in any shared environment.**
679
613
 
680
- **VPC-config Lambdas (PR 8b)**: handlers with `Properties.VpcConfig`
614
+ **VPC-config Lambdas**: handlers with `Properties.VpcConfig`
681
615
  still run locally, but the local container is NOT attached to the
682
616
  deployed VPC's subnets — calls to private RDS / ElastiCache will fail.
683
617
  cdkd warns at startup naming each affected Lambda; AWS SDK calls still
package/dist/cli.js CHANGED
@@ -70567,9 +70567,13 @@ var SUPPORTED_RUNTIMES = {
70567
70567
  "nodejs18.x": { image: "public.ecr.aws/lambda/nodejs:18", fileExtension: ".js" },
70568
70568
  "nodejs20.x": { image: "public.ecr.aws/lambda/nodejs:20", fileExtension: ".js" },
70569
70569
  "nodejs22.x": { image: "public.ecr.aws/lambda/nodejs:22", fileExtension: ".js" },
70570
+ "nodejs24.x": { image: "public.ecr.aws/lambda/nodejs:24", fileExtension: ".js" },
70570
70571
  "python3.11": { image: "public.ecr.aws/lambda/python:3.11", fileExtension: ".py" },
70571
70572
  "python3.12": { image: "public.ecr.aws/lambda/python:3.12", fileExtension: ".py" },
70572
- "python3.13": { image: "public.ecr.aws/lambda/python:3.13", fileExtension: ".py" }
70573
+ "python3.13": { image: "public.ecr.aws/lambda/python:3.13", fileExtension: ".py" },
70574
+ "python3.14": { image: "public.ecr.aws/lambda/python:3.14", fileExtension: ".py" },
70575
+ "ruby3.2": { image: "public.ecr.aws/lambda/ruby:3.2", fileExtension: ".rb" },
70576
+ "ruby3.3": { image: "public.ecr.aws/lambda/ruby:3.3", fileExtension: ".rb" }
70573
70577
  };
70574
70578
  var UnsupportedRuntimeError = class _UnsupportedRuntimeError extends Error {
70575
70579
  constructor(runtime, message) {
@@ -70595,15 +70599,15 @@ function resolveRuntimeSpec(runtime) {
70595
70599
  const spec = SUPPORTED_RUNTIMES[runtime];
70596
70600
  if (spec)
70597
70601
  return spec;
70598
- if (runtime.startsWith("java") || runtime.startsWith("dotnet") || runtime.startsWith("ruby") || runtime.startsWith("go") || runtime.startsWith("provided")) {
70602
+ if (runtime.startsWith("java") || runtime.startsWith("dotnet") || runtime.startsWith("go") || runtime.startsWith("provided")) {
70599
70603
  throw new UnsupportedRuntimeError(
70600
70604
  runtime,
70601
- `Runtime '${runtime}' is not supported in cdkd local invoke v1. Only Node.js (nodejs18.x / nodejs20.x / nodejs22.x) and Python (python3.11 / python3.12 / python3.13) runtimes are supported. Other runtimes follow in subsequent PRs.`
70605
+ `Runtime '${runtime}' is not yet supported in cdkd local invoke. Supported runtimes: Node.js (nodejs18.x / nodejs20.x / nodejs22.x / nodejs24.x), Python (python3.11 / python3.12 / python3.13 / python3.14), Ruby (ruby3.2 / ruby3.3). Other runtimes follow in subsequent PRs.`
70602
70606
  );
70603
70607
  }
70604
70608
  throw new UnsupportedRuntimeError(
70605
70609
  runtime,
70606
- `Unknown runtime '${runtime}'. cdkd local invoke v1 supports nodejs18.x / nodejs20.x / nodejs22.x / python3.11 / python3.12 / python3.13.`
70610
+ `Unknown runtime '${runtime}'. cdkd local invoke supports nodejs18.x / nodejs20.x / nodejs22.x / nodejs24.x / python3.11 / python3.12 / python3.13 / python3.14 / ruby3.2 / ruby3.3.`
70607
70611
  );
70608
70612
  }
70609
70613
 
@@ -77028,7 +77032,7 @@ function reorderArgs(argv) {
77028
77032
  }
77029
77033
  async function main() {
77030
77034
  const program = new Command16();
77031
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.75.2");
77035
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.77.0");
77032
77036
  program.addCommand(createBootstrapCommand());
77033
77037
  program.addCommand(createSynthCommand());
77034
77038
  program.addCommand(createListCommand());