@go-to-k/cdkd 0.78.0 → 0.80.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
@@ -498,15 +498,19 @@ Lambda Runtime Interface Emulator (RIE). Modeled on `sam local invoke`
498
498
  but reusing cdkd's synthesis / asset / construct-path plumbing — no
499
499
  `template.yaml` to maintain, no `cdk synth | sam ...` round-trip.
500
500
 
501
- Requires Docker. Supports Node.js, Python, Ruby, and Java runtimes
501
+ Requires Docker. Supports every current AWS Lambda runtime
502
502
  (`nodejs18.x` / `nodejs20.x` / `nodejs22.x` / `nodejs24.x` / `python3.11` /
503
503
  `python3.12` / `python3.13` / `python3.14` / `ruby3.2` / `ruby3.3` /
504
- `java8.al2` / `java11` / `java17` / `java21`); other runtimes (.NET / Go /
505
- `provided.*`) are not yet supported. Java Lambdas are **asset-backed only** —
506
- the Handler shape `package.Class::method` names a compiled class, so use
507
- `lambda.Code.fromAsset(<dir>)` with a directory containing the compiled
508
- output (`.class` hierarchy or `.jar`); inline `Code.ZipFile` is rejected
509
- with a clear routing message.
504
+ `java8.al2` / `java11` / `java17` / `java21` / `dotnet6` / `dotnet8` /
505
+ `provided.al2` / `provided.al2023`). The deprecated `go1.x` runtime is
506
+ rejected with a migration pointer to `provided.al2023`. Java, .NET, and
507
+ `provided.*` Lambdas are **asset-backed only** the Handler shape names
508
+ a compiled artifact (`package.Class::method` for Java's JVM class;
509
+ `Assembly::Namespace.Class::Method` for .NET's CLR assembly; an
510
+ arbitrary `bootstrap` binary for the OS-only `provided.*` runtimes), so
511
+ use `lambda.Code.fromAsset(<dir>)` with a directory containing the
512
+ compiled output (`.class` hierarchy / `.jar` / `.dll` / native binary);
513
+ inline `Code.ZipFile` is rejected with a clear routing message.
510
514
 
511
515
  **Container Lambdas** — `lambda.DockerImageFunction(...)` /
512
516
  `Code.ImageUri` is supported alongside ZIP Lambdas. cdkd reads the
package/dist/cli.js CHANGED
@@ -70577,7 +70577,11 @@ var SUPPORTED_RUNTIMES = {
70577
70577
  "java8.al2": { image: "public.ecr.aws/lambda/java:8.al2", fileExtension: null },
70578
70578
  java11: { image: "public.ecr.aws/lambda/java:11", fileExtension: null },
70579
70579
  java17: { image: "public.ecr.aws/lambda/java:17", fileExtension: null },
70580
- java21: { image: "public.ecr.aws/lambda/java:21", fileExtension: null }
70580
+ java21: { image: "public.ecr.aws/lambda/java:21", fileExtension: null },
70581
+ dotnet6: { image: "public.ecr.aws/lambda/dotnet:6", fileExtension: null },
70582
+ dotnet8: { image: "public.ecr.aws/lambda/dotnet:8", fileExtension: null },
70583
+ "provided.al2": { image: "public.ecr.aws/lambda/provided:al2", fileExtension: null },
70584
+ "provided.al2023": { image: "public.ecr.aws/lambda/provided:al2023", fileExtension: null }
70581
70585
  };
70582
70586
  var UnsupportedRuntimeError = class _UnsupportedRuntimeError extends Error {
70583
70587
  constructor(runtime, message) {
@@ -70595,7 +70599,7 @@ function resolveRuntimeFileExtension(runtime) {
70595
70599
  if (spec.fileExtension === null) {
70596
70600
  throw new UnsupportedRuntimeError(
70597
70601
  runtime,
70598
- `Inline 'Code.ZipFile' is not supported for runtime '${runtime}'. The Lambda Handler shape for this runtime names a compiled artifact (a JVM class, a .NET assembly, or a native binary) that cannot be expressed as a single inline source file. Use \`lambda.Code.fromAsset(<dir>)\` with a directory containing the compiled output (.class hierarchy / JAR / DLL / binary).`
70602
+ `Inline 'Code.ZipFile' is not supported for runtime '${runtime}'. The Lambda Handler shape for this runtime names a compiled artifact (a JVM class, a .NET assembly, or \u2014 for the OS-only \`provided.*\` runtimes \u2014 an arbitrary \`bootstrap\` binary) that cannot be expressed as a single inline source file. Use \`lambda.Code.fromAsset(<dir>)\` with a directory containing the compiled output (.class hierarchy / JAR / DLL / native binary).`
70599
70603
  );
70600
70604
  }
70601
70605
  return spec.fileExtension;
@@ -70610,17 +70614,24 @@ function resolveRuntimeSpec(runtime) {
70610
70614
  const spec = SUPPORTED_RUNTIMES[runtime];
70611
70615
  if (spec)
70612
70616
  return spec;
70613
- if (runtime.startsWith("dotnet") || runtime.startsWith("go") || runtime.startsWith("provided")) {
70617
+ if (runtime === "go1.x") {
70614
70618
  throw new UnsupportedRuntimeError(
70615
70619
  runtime,
70616
- `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), Java (java8.al2 / java11 / java17 / java21). Other runtimes follow in subsequent PRs.`
70620
+ `Runtime 'go1.x' was deprecated by AWS Lambda on 2024-01-08 and is no longer available. Migrate to the OS-only runtime: build your Go program as a \`bootstrap\` binary and set the CDK runtime to \`lambda.Runtime.PROVIDED_AL2023\` (or \`lambda.Runtime.PROVIDED_AL2\`). See https://docs.aws.amazon.com/lambda/latest/dg/lambda-golang.html`
70617
70621
  );
70618
70622
  }
70619
70623
  throw new UnsupportedRuntimeError(
70620
70624
  runtime,
70621
- `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 / java8.al2 / java11 / java17 / java21.`
70625
+ `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 / java8.al2 / java11 / java17 / java21 / dotnet6 / dotnet8 / provided.al2 / provided.al2023.`
70622
70626
  );
70623
70627
  }
70628
+ function resolveRuntimeCodeMountPath(runtime) {
70629
+ resolveRuntimeSpec(runtime);
70630
+ if (runtime === "provided.al2" || runtime === "provided.al2023") {
70631
+ return "/var/runtime";
70632
+ }
70633
+ return "/var/task";
70634
+ }
70624
70635
 
70625
70636
  // src/local/docker-runner.ts
70626
70637
  import { execFile as execFile3, spawn as spawn3 } from "node:child_process";
@@ -71573,9 +71584,10 @@ function createContainerPool(specs, options) {
71573
71584
  `Starting container ${name} for ${spec.lambda.logicalId} on ${spec.containerHost}:${hostPort}`
71574
71585
  );
71575
71586
  const optMount = spec.optDir ? [{ hostPath: spec.optDir, containerPath: "/opt", readOnly: true }] : [];
71587
+ const containerCodePath = resolveRuntimeCodeMountPath(spec.lambda.runtime);
71576
71588
  const containerId = await runDetached({
71577
71589
  image,
71578
- mounts: [{ hostPath: spec.codeDir, containerPath: "/var/task", readOnly: true }],
71590
+ mounts: [{ hostPath: spec.codeDir, containerPath: containerCodePath, readOnly: true }],
71579
71591
  extraMounts: optMount,
71580
71592
  env: spec.env,
71581
71593
  cmd: [spec.lambda.handler],
@@ -76668,9 +76680,10 @@ async function resolveZipImagePlan(lambda, options) {
76668
76680
  const image = resolveRuntimeImage(lambda.runtime);
76669
76681
  await pullImage(image, options.pull === false);
76670
76682
  const layerPlan = materializeLambdaLayers2(lambda.layers);
76683
+ const containerCodePath = resolveRuntimeCodeMountPath(lambda.runtime);
76671
76684
  return {
76672
76685
  image,
76673
- mounts: [{ hostPath: codeDir, containerPath: "/var/task", readOnly: true }],
76686
+ mounts: [{ hostPath: codeDir, containerPath: containerCodePath, readOnly: true }],
76674
76687
  extraMounts: layerPlan.mount ? [layerPlan.mount] : [],
76675
76688
  cmd: [lambda.handler],
76676
76689
  ...inlineTmpDir !== void 0 && { inlineTmpDir },
@@ -77043,7 +77056,7 @@ function reorderArgs(argv) {
77043
77056
  }
77044
77057
  async function main() {
77045
77058
  const program = new Command16();
77046
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.78.0");
77059
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.80.0");
77047
77060
  program.addCommand(createBootstrapCommand());
77048
77061
  program.addCommand(createSynthCommand());
77049
77062
  program.addCommand(createListCommand());