@go-to-k/cdkd 0.231.8 → 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.
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-D-51YceH.js → deploy-engine-CINi8mJy.js} +113 -11
- package/dist/deploy-engine-CINi8mJy.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-D-51YceH.js.map +0 -1
|
@@ -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
|
-
*
|
|
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
|
|
5549
|
-
* `Fn::GetAtt[Up, Attr]` or `Fn::Sub`'s `${Up.Attr}`) an attribute
|
|
5550
|
-
*
|
|
5551
|
-
*
|
|
5552
|
-
*
|
|
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
|
|
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 (
|
|
5588
|
-
|
|
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
|
}
|
|
@@ -8971,11 +9013,71 @@ var CloudControlProvider = class {
|
|
|
8971
9013
|
this.logger.debug(`Failed to enrich OpenSearch Domain ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
8972
9014
|
}
|
|
8973
9015
|
break;
|
|
9016
|
+
case "AWS::Backup::BackupVault":
|
|
9017
|
+
if (!enriched["BackupVaultArn"]) {
|
|
9018
|
+
const model = await this.readBackupResourceModel(resourceType, physicalId);
|
|
9019
|
+
if (model) {
|
|
9020
|
+
if (typeof model["BackupVaultArn"] === "string") enriched["BackupVaultArn"] = model["BackupVaultArn"];
|
|
9021
|
+
if (!enriched["BackupVaultName"] && typeof model["BackupVaultName"] === "string") enriched["BackupVaultName"] = model["BackupVaultName"];
|
|
9022
|
+
this.logger.debug(`Enriched Backup BackupVault ${physicalId} with BackupVaultArn from CC GetResource`);
|
|
9023
|
+
}
|
|
9024
|
+
}
|
|
9025
|
+
if (!enriched["BackupVaultName"]) enriched["BackupVaultName"] = physicalId;
|
|
9026
|
+
break;
|
|
9027
|
+
case "AWS::Backup::BackupPlan":
|
|
9028
|
+
if (!enriched["BackupPlanArn"] || !enriched["VersionId"]) {
|
|
9029
|
+
const model = await this.readBackupResourceModel(resourceType, physicalId);
|
|
9030
|
+
if (model) {
|
|
9031
|
+
if (!enriched["BackupPlanArn"] && typeof model["BackupPlanArn"] === "string") enriched["BackupPlanArn"] = model["BackupPlanArn"];
|
|
9032
|
+
if (!enriched["VersionId"] && typeof model["VersionId"] === "string") enriched["VersionId"] = model["VersionId"];
|
|
9033
|
+
if (!enriched["BackupPlanId"] && typeof model["BackupPlanId"] === "string") enriched["BackupPlanId"] = model["BackupPlanId"];
|
|
9034
|
+
this.logger.debug(`Enriched Backup BackupPlan ${physicalId} with BackupPlanArn/VersionId from CC GetResource`);
|
|
9035
|
+
}
|
|
9036
|
+
}
|
|
9037
|
+
if (!enriched["BackupPlanId"]) enriched["BackupPlanId"] = physicalId;
|
|
9038
|
+
break;
|
|
9039
|
+
case "AWS::Backup::BackupSelection":
|
|
9040
|
+
if (!enriched["SelectionId"] || !enriched["BackupPlanId"]) {
|
|
9041
|
+
const compoundSegments = physicalId.split("|");
|
|
9042
|
+
if (compoundSegments.length >= 2) {
|
|
9043
|
+
if (!enriched["SelectionId"]) enriched["SelectionId"] = compoundSegments[0];
|
|
9044
|
+
if (!enriched["BackupPlanId"]) enriched["BackupPlanId"] = compoundSegments[1];
|
|
9045
|
+
}
|
|
9046
|
+
const model = await this.readBackupResourceModel(resourceType, physicalId);
|
|
9047
|
+
if (model) {
|
|
9048
|
+
if (typeof model["SelectionId"] === "string") enriched["SelectionId"] = model["SelectionId"];
|
|
9049
|
+
if (typeof model["BackupPlanId"] === "string") enriched["BackupPlanId"] = model["BackupPlanId"];
|
|
9050
|
+
this.logger.debug(`Enriched Backup BackupSelection ${physicalId} with SelectionId from CC GetResource`);
|
|
9051
|
+
}
|
|
9052
|
+
}
|
|
9053
|
+
break;
|
|
8974
9054
|
default: break;
|
|
8975
9055
|
}
|
|
8976
9056
|
return enriched;
|
|
8977
9057
|
}
|
|
8978
9058
|
/**
|
|
9059
|
+
* Read the Cloud Control GetResource model for a pure-CC Backup resource and
|
|
9060
|
+
* return its parsed property map, or `undefined` on any failure. Backup types
|
|
9061
|
+
* have no SDK provider, so this generic CC read-back is the cleanest source
|
|
9062
|
+
* of their readOnly attributes (ARNs, VersionId, SelectionId) that the sparse
|
|
9063
|
+
* CREATE ResourceModel does not reliably surface. Best-effort: never throws.
|
|
9064
|
+
*/
|
|
9065
|
+
async readBackupResourceModel(resourceType, physicalId) {
|
|
9066
|
+
try {
|
|
9067
|
+
const raw = (await this.cloudControlClient.send(new GetResourceCommand({
|
|
9068
|
+
TypeName: resourceType,
|
|
9069
|
+
Identifier: physicalId
|
|
9070
|
+
}))).ResourceDescription?.Properties;
|
|
9071
|
+
if (typeof raw !== "string" || raw.length === 0) return;
|
|
9072
|
+
const parsed = JSON.parse(raw);
|
|
9073
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return;
|
|
9074
|
+
return parsed;
|
|
9075
|
+
} catch (error) {
|
|
9076
|
+
this.logger.debug(`Failed to read CC model for ${resourceType} ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
9077
|
+
return;
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
/**
|
|
8979
9081
|
* Handle errors and throw ProvisioningError
|
|
8980
9082
|
*/
|
|
8981
9083
|
handleError(error, operation, resourceType, logicalId, physicalId) {
|
|
@@ -14895,4 +14997,4 @@ var DeployEngine = class {
|
|
|
14895
14997
|
|
|
14896
14998
|
//#endregion
|
|
14897
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 };
|
|
14898
|
-
//# sourceMappingURL=deploy-engine-
|
|
15000
|
+
//# sourceMappingURL=deploy-engine-CINi8mJy.js.map
|