@go-to-k/cdkd 0.116.0 → 0.116.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/dist/cli.js CHANGED
@@ -6434,11 +6434,14 @@ var LambdaFunctionProvider = class {
6434
6434
  * etc.) are filtered at compare time — we still avoid serializing them on
6435
6435
  * the wire.
6436
6436
  *
6437
- * `Code` is intentionally omitted: `GetFunction` returns a pre-signed S3
6438
- * URL for the deployed code, not the asset hash cdkd state holds, so they
6439
- * could never match. Lambda code drift is best detected separately (the
6440
- * function's `CodeSha256` does live in `GetFunction` but is not what
6441
- * cdkd's `Code: { S3Bucket, S3Key }` state property carries).
6437
+ * `Code.S3Bucket` / `Code.S3Key` / `Code.S3ObjectVersion` / `Code.ZipFile`
6438
+ * are not surfaced: `GetFunction` returns a pre-signed S3 URL for the
6439
+ * deployed code, not the asset hash cdkd state holds, so they could
6440
+ * never match. Those keys are declared via `getDriftUnknownPaths` so
6441
+ * the drift comparator skips them. `Code.ImageUri` IS surfaced for
6442
+ * container Lambdas (`PackageType: 'Image'`) — AWS returns it on the
6443
+ * `GetFunction.Code.ImageUri` field, so a console-side image swap is
6444
+ * detectable as drift.
6442
6445
  *
6443
6446
  * `Tags` is surfaced from the `Tags` map on the same `GetFunction`
6444
6447
  * response. CDK's auto-injected `aws:cdk:*` tags (which AWS happily
@@ -6467,6 +6470,7 @@ var LambdaFunctionProvider = class {
6467
6470
  result["Layers"] = (cfg.Layers ?? []).map((l) => l.Arn).filter((arn) => !!arn);
6468
6471
  result["Architectures"] = cfg.Architectures ? [...cfg.Architectures] : [];
6469
6472
  if (cfg.PackageType !== void 0) result["PackageType"] = cfg.PackageType;
6473
+ if (resp.Code?.ImageUri !== void 0) result["Code"] = { ImageUri: resp.Code.ImageUri };
6470
6474
  result["TracingConfig"] = { Mode: cfg.TracingConfig?.Mode ?? "PassThrough" };
6471
6475
  if (cfg.EphemeralStorage?.Size !== void 0) result["EphemeralStorage"] = { Size: cfg.EphemeralStorage.Size };
6472
6476
  result["VpcConfig"] = {
@@ -6482,15 +6486,30 @@ var LambdaFunctionProvider = class {
6482
6486
  }
6483
6487
  }
6484
6488
  /**
6485
- * `Code: { S3Bucket, S3Key }` is set on create / update but `GetFunction`
6486
- * only returns a pre-signed URL for the deployed code, never the original
6487
- * asset key — so a state-recorded `Code` value can never match an
6488
- * AWS-current snapshot. Tell the drift comparator to skip the whole
6489
- * `Code` subtree to avoid the guaranteed false-positive that would fire
6490
- * on every clean run.
6489
+ * Lambda ZIP-package `Code` sub-paths AWS does not return on read.
6490
+ *
6491
+ * `GetFunction` returns a pre-signed S3 URL for ZIP-deployed code
6492
+ * (`Code.Location`), not the original `S3Bucket` / `S3Key` cdkd state
6493
+ * holds. `ZipFile` is inline source that AWS never echoes back. These
6494
+ * three fields are write-only via the GetFunction API (Category 1).
6495
+ *
6496
+ * `Code.ImageUri` IS recoverable — `GetFunction.Code.ImageUri` returns
6497
+ * the templated image URI for container Lambdas — so it is surfaced by
6498
+ * `readCurrentState` and NOT declared drift-unknown. `Code.SourceKMSKeyArn`
6499
+ * is also write-only on the FunctionCodeLocation read shape.
6500
+ *
6501
+ * Pre-PR this method returned the whole `['Code']` subtree as
6502
+ * drift-unknown, which also hid `Code.ImageUri` drift on container
6503
+ * Lambdas. Narrowing the skip-list re-enables that detection.
6491
6504
  */
6492
6505
  getDriftUnknownPaths() {
6493
- return ["Code"];
6506
+ return [
6507
+ "Code.S3Bucket",
6508
+ "Code.S3Key",
6509
+ "Code.S3ObjectVersion",
6510
+ "Code.ZipFile",
6511
+ "Code.SourceKMSKeyArn"
6512
+ ];
6494
6513
  }
6495
6514
  /**
6496
6515
  * Adopt an existing Lambda function into cdkd state.
@@ -45623,7 +45642,7 @@ function reorderArgs(argv) {
45623
45642
  */
45624
45643
  async function main() {
45625
45644
  const program = new Command();
45626
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.116.0");
45645
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.116.1");
45627
45646
  program.addCommand(createBootstrapCommand());
45628
45647
  program.addCommand(createSynthCommand());
45629
45648
  program.addCommand(createListCommand());