@go-to-k/cdkd 0.231.9 → 0.231.10

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.
@@ -5337,6 +5337,31 @@ function unescapeJsonPointerSegment$1(segment) {
5337
5337
  //#endregion
5338
5338
  //#region src/analyzer/diff-calculator.ts
5339
5339
  /**
5340
+ * Per-type set of computed/derived read-only attributes whose value can change
5341
+ * as a side effect of an IN-PLACE update, even though the attribute NAME never
5342
+ * appears among the type's template properties (issue #985).
5343
+ *
5344
+ * The default in-place propagation arm matches a dependent only when the GetAtt
5345
+ * attribute NAME equals a template property that CHANGED on the upstream (e.g.
5346
+ * an SSM Parameter `Value`). That arm cannot see version-style attributes: an
5347
+ * `AWS::EC2::LaunchTemplate` edit changes `LaunchTemplateData`, which bumps the
5348
+ * read-only `LatestVersionNumber` from N to N+1 — but `LatestVersionNumber` is
5349
+ * NOT a template property, so a dependent reading `Fn::GetAtt[Lt,
5350
+ * LatestVersionNumber]` (the canonical `autoscaling.AutoScalingGroup`
5351
+ * `LaunchTemplate.Version` shape) is left NO_CHANGE and stays pinned one deploy
5352
+ * behind. These attributes resolve LIVE from AWS at deploy time (see the
5353
+ * `DescribeLaunchTemplates` special case in intrinsic-function-resolver.ts), so
5354
+ * a speculative promotion is safe: the deploy engine re-resolves the dependent
5355
+ * against the fresh live value and skips the provider call if it did not move.
5356
+ *
5357
+ * Keyed by upstream resource type -> the derived attribute names that any
5358
+ * in-place UPDATE of that type may move. Kept intentionally narrow (an allow
5359
+ * list, not "every read-only attr") so unrelated computed attributes that do
5360
+ * NOT track in-place edits (e.g. a Lambda `Arn`) never trigger spurious
5361
+ * dependent promotion.
5362
+ */
5363
+ const IN_PLACE_UPDATE_DERIVED_ATTRS = Object.freeze({ "AWS::EC2::LaunchTemplate": new Set(["LatestVersionNumber", "DefaultVersionNumber"]) });
5364
+ /**
5340
5365
  * Diff calculator for comparing desired state (template) with current state
5341
5366
  */
5342
5367
  var DiffCalculator = class DiffCalculator {
@@ -5541,15 +5566,24 @@ var DiffCalculator = class DiffCalculator {
5541
5566
  }
5542
5567
  /**
5543
5568
  * Promote NO_CHANGE dependents of an IN-PLACE update whose referenced ATTRIBUTE
5544
- * actually changed (bug-hunt 2026-06-29).
5569
+ * either names a changed property (bug-hunt 2026-06-29) OR is a derived
5570
+ * read-only attribute the update side-effects (issue #985).
5545
5571
  *
5546
5572
  * Distinct from {@link promoteReplacementDependents}: a replacement changes the
5547
5573
  * physical id, so any reference is affected. An in-place update changes only
5548
- * specific properties, so a dependent is affected ONLY when it reads (via
5549
- * `Fn::GetAtt[Up, Attr]` or `Fn::Sub`'s `${Up.Attr}`) an attribute whose NAME
5550
- * matches a property that changed in `Up`'s update. (`Ref` resolves to the
5551
- * physical id, which an in-place update never moves, so Ref-only dependents are
5552
- * left NO_CHANGE; likewise a GetAtt of a computed / unchanged attribute.)
5574
+ * specific properties, so a dependent is affected in one of two ways when it
5575
+ * reads (via `Fn::GetAtt[Up, Attr]` or `Fn::Sub`'s `${Up.Attr}`) an attribute
5576
+ * of an updated `Up`:
5577
+ * 1. `Attr` NAMES a property that CHANGED in `Up`'s update (e.g. an SSM
5578
+ * Parameter `Value` embedded in a downstream `Fn::Sub`); or
5579
+ * 2. `Attr` is a DERIVED read-only attribute of `Up`'s type that an in-place
5580
+ * update side-effects even though it is not a template property — the
5581
+ * per-type {@link IN_PLACE_UPDATE_DERIVED_ATTRS} allow list (issue #985;
5582
+ * e.g. `AWS::EC2::LaunchTemplate.LatestVersionNumber`, which an
5583
+ * `autoscaling.AutoScalingGroup` reads for its `LaunchTemplate.Version`).
5584
+ * (`Ref` resolves to the physical id, which an in-place update never moves, so
5585
+ * Ref-only dependents are left NO_CHANGE; likewise a GetAtt of a computed
5586
+ * attribute NOT in the allow list, e.g. a Lambda `Arn` on a Description edit.)
5553
5587
  *
5554
5588
  * Promotion is safe even when speculative: the deploy engine re-resolves the
5555
5589
  * promoted resource against the in-flight state and skips the provider call
@@ -5564,12 +5598,15 @@ var DiffCalculator = class DiffCalculator {
5564
5598
  */
5565
5599
  promoteInPlaceAttributeDependents(changes, desiredTemplate, rawGetAttRefs) {
5566
5600
  const changedPropsByUpstream = /* @__PURE__ */ new Map();
5601
+ const inPlaceUpdateTypeByUpstream = /* @__PURE__ */ new Map();
5567
5602
  for (const [logicalId, change] of changes) {
5568
5603
  if (change.changeType !== "UPDATE") continue;
5569
- const props = (change.propertyChanges ?? []).map((pc) => pc.path).filter((p) => typeof p === "string");
5604
+ const propertyChanges = change.propertyChanges ?? [];
5605
+ if (!propertyChanges.some((pc) => pc.requiresReplacement)) inPlaceUpdateTypeByUpstream.set(logicalId, change.resourceType);
5606
+ const props = propertyChanges.map((pc) => pc.path).filter((p) => typeof p === "string");
5570
5607
  if (props.length > 0) changedPropsByUpstream.set(logicalId, new Set(props));
5571
5608
  }
5572
- if (changedPropsByUpstream.size === 0) return;
5609
+ if (changedPropsByUpstream.size === 0 && inPlaceUpdateTypeByUpstream.size === 0) return;
5573
5610
  for (const [dependentId, perProp] of rawGetAttRefs) {
5574
5611
  const resource = desiredTemplate.Resources[dependentId];
5575
5612
  if (!resource || resource.Type === "AWS::CDK::Metadata") continue;
@@ -5584,8 +5621,13 @@ var DiffCalculator = class DiffCalculator {
5584
5621
  for (const [upstreamId, attrs] of getAttRefs) {
5585
5622
  if (upstreamId === dependentId) continue;
5586
5623
  const changedProps = changedPropsByUpstream.get(upstreamId);
5587
- if (!changedProps) continue;
5588
- if ([...attrs].some((attr) => changedProps.has(attr))) {
5624
+ if (changedProps && [...attrs].some((attr) => changedProps.has(attr))) {
5625
+ matched = true;
5626
+ break;
5627
+ }
5628
+ const upstreamType = inPlaceUpdateTypeByUpstream.get(upstreamId);
5629
+ const derivedAttrs = upstreamType ? IN_PLACE_UPDATE_DERIVED_ATTRS[upstreamType] : void 0;
5630
+ if (derivedAttrs && [...attrs].some((attr) => derivedAttrs.has(attr))) {
5589
5631
  matched = true;
5590
5632
  break;
5591
5633
  }
@@ -14955,4 +14997,4 @@ var DeployEngine = class {
14955
14997
 
14956
14998
  //#endregion
14957
14999
  export { resolveSkipPrefix as $, DiffCalculator as A, buildDockerImage as B, findActionableSilentDrops as C, refStateLookupFromResource as D, cfnRefValueFromPhysicalId as E, rebuildClientForBucketRegion as F, AssetManifestLoader as G, getDockerCmd as H, shouldRetainResource as I, synthesisStatusMessage as J, getDockerImageBySourceHash as K, AssetPublisher as L, TemplateParser as M, LockManager as N, WAFv2WebACLProvider as O, S3StateBackend as P, resolveCaptureObservedState as Q, stringifyValue as R, ProviderRegistry as S, IntrinsicFunctionResolver as T, runDockerForeground as U, formatDockerLoginError as V, runDockerStreaming as W, getLegacyStateBucketName as X, getDefaultStateBucketName as Y, resolveApp as Z, green as _, withRetry as a, MIGRATE_TMP_PREFIX as at, IAMRoleProvider as b, computeImplicitDeleteEdges as c, AssemblyReader as ct, isStatefulRecreateTargetSync as d, resolveStateBucketWithDefault as et, renderStatefulReason as f, gray as g, cyan as h, withResourceDeadline as i, CFN_TEMPLATE_URL_LIMIT as it, DagBuilder as j, applyRoleArnIfSet as k, extractDeploymentEventError as l, clearBucketRegionCache as lt, bold as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, warnDeprecatedNoPrefixCliFlag as nt, isRetryableTransientError as o, findLargeInlineResources as ot, formatResourceLine as p, Synthesizer as q, DeployEngine as r, CFN_TEMPLATE_BODY_LIMIT as rt, IMPLICIT_DELETE_DEPENDENCIES as s, uploadCfnTemplate as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, resolveStateBucketWithDefaultAndSource as tt, MULTI_REGION_RECREATE_BLOCKED_TYPES as u, resolveBucketRegion as ut, red as v, CloudControlProvider as w, collectInlinePolicyNamesManagedBySiblings as x, yellow as y, WorkGraph as z };
14958
- //# sourceMappingURL=deploy-engine-BvraZ92_.js.map
15000
+ //# sourceMappingURL=deploy-engine-CINi8mJy.js.map