@go-to-k/cdkd 0.79.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,17 +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, Java, and .NET 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` / `dotnet6` / `dotnet8`);
505
- other runtimes (Go / `provided.*`) are not yet supported. Java and .NET
506
- Lambdas are **asset-backed only** the Handler shape names a compiled
507
- artifact (`package.Class::method` for Java's JVM class;
508
- `Assembly::Namespace.Class::Method` for .NET's CLR assembly), so use
509
- `lambda.Code.fromAsset(<dir>)` with a directory containing the compiled
510
- output (`.class` hierarchy / `.jar` / `.dll`); inline `Code.ZipFile` is
511
- rejected 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.
512
514
 
513
515
  **Container Lambdas** — `lambda.DockerImageFunction(...)` /
514
516
  `Code.ImageUri` is supported alongside ZIP Lambdas. cdkd reads the
package/dist/cli.js CHANGED
@@ -70579,7 +70579,9 @@ var SUPPORTED_RUNTIMES = {
70579
70579
  java17: { image: "public.ecr.aws/lambda/java:17", fileExtension: null },
70580
70580
  java21: { image: "public.ecr.aws/lambda/java:21", fileExtension: null },
70581
70581
  dotnet6: { image: "public.ecr.aws/lambda/dotnet:6", fileExtension: null },
70582
- dotnet8: { image: "public.ecr.aws/lambda/dotnet:8", 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 }
70583
70585
  };
70584
70586
  var UnsupportedRuntimeError = class _UnsupportedRuntimeError extends Error {
70585
70587
  constructor(runtime, message) {
@@ -70597,7 +70599,7 @@ function resolveRuntimeFileExtension(runtime) {
70597
70599
  if (spec.fileExtension === null) {
70598
70600
  throw new UnsupportedRuntimeError(
70599
70601
  runtime,
70600
- `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).`
70601
70603
  );
70602
70604
  }
70603
70605
  return spec.fileExtension;
@@ -70612,17 +70614,24 @@ function resolveRuntimeSpec(runtime) {
70612
70614
  const spec = SUPPORTED_RUNTIMES[runtime];
70613
70615
  if (spec)
70614
70616
  return spec;
70615
- if (runtime.startsWith("go") || runtime.startsWith("provided")) {
70617
+ if (runtime === "go1.x") {
70616
70618
  throw new UnsupportedRuntimeError(
70617
70619
  runtime,
70618
- `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), .NET (dotnet6 / dotnet8). 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`
70619
70621
  );
70620
70622
  }
70621
70623
  throw new UnsupportedRuntimeError(
70622
70624
  runtime,
70623
- `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.`
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.`
70624
70626
  );
70625
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
+ }
70626
70635
 
70627
70636
  // src/local/docker-runner.ts
70628
70637
  import { execFile as execFile3, spawn as spawn3 } from "node:child_process";
@@ -71575,9 +71584,10 @@ function createContainerPool(specs, options) {
71575
71584
  `Starting container ${name} for ${spec.lambda.logicalId} on ${spec.containerHost}:${hostPort}`
71576
71585
  );
71577
71586
  const optMount = spec.optDir ? [{ hostPath: spec.optDir, containerPath: "/opt", readOnly: true }] : [];
71587
+ const containerCodePath = resolveRuntimeCodeMountPath(spec.lambda.runtime);
71578
71588
  const containerId = await runDetached({
71579
71589
  image,
71580
- mounts: [{ hostPath: spec.codeDir, containerPath: "/var/task", readOnly: true }],
71590
+ mounts: [{ hostPath: spec.codeDir, containerPath: containerCodePath, readOnly: true }],
71581
71591
  extraMounts: optMount,
71582
71592
  env: spec.env,
71583
71593
  cmd: [spec.lambda.handler],
@@ -76670,9 +76680,10 @@ async function resolveZipImagePlan(lambda, options) {
76670
76680
  const image = resolveRuntimeImage(lambda.runtime);
76671
76681
  await pullImage(image, options.pull === false);
76672
76682
  const layerPlan = materializeLambdaLayers2(lambda.layers);
76683
+ const containerCodePath = resolveRuntimeCodeMountPath(lambda.runtime);
76673
76684
  return {
76674
76685
  image,
76675
- mounts: [{ hostPath: codeDir, containerPath: "/var/task", readOnly: true }],
76686
+ mounts: [{ hostPath: codeDir, containerPath: containerCodePath, readOnly: true }],
76676
76687
  extraMounts: layerPlan.mount ? [layerPlan.mount] : [],
76677
76688
  cmd: [lambda.handler],
76678
76689
  ...inlineTmpDir !== void 0 && { inlineTmpDir },
@@ -77045,7 +77056,7 @@ function reorderArgs(argv) {
77045
77056
  }
77046
77057
  async function main() {
77047
77058
  const program = new Command16();
77048
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.79.0");
77059
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.80.0");
77049
77060
  program.addCommand(createBootstrapCommand());
77050
77061
  program.addCommand(createSynthCommand());
77051
77062
  program.addCommand(createListCommand());