@go-to-k/cdkd 0.280.22 → 0.280.24
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/{asg-provider-DVoWhe5E.js → asg-provider-Dpx4B6UA.js} +2 -2
- package/dist/{asg-provider-DVoWhe5E.js.map → asg-provider-Dpx4B6UA.js.map} +1 -1
- package/dist/cli.js +122 -26
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-DObU-2va.js → deploy-engine-60FIug-P.js} +74 -14
- package/dist/deploy-engine-60FIug-P.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-DObU-2va.js.map +0 -1
|
@@ -8421,9 +8421,15 @@ var DiffCalculator = class DiffCalculator {
|
|
|
8421
8421
|
* buried inside intrinsics (e.g. `Fn::Join` literal args) are detected.
|
|
8422
8422
|
* If resolution throws for a given property value, the unresolved
|
|
8423
8423
|
* value is used (falling back to the original "assume equal" behavior).
|
|
8424
|
+
* @param canonicalizeProperties Optional per-type normalization applied to BOTH
|
|
8425
|
+
* comparison sides (issue #1591) — see {@link CanonicalizePropertiesFn}
|
|
8426
|
+
* for why one-sided normalization breaks the very population it is
|
|
8427
|
+
* meant to fix. Injected as a function rather than as a provider
|
|
8428
|
+
* registry so the analyzer layer keeps no dependency on the
|
|
8429
|
+
* provisioning layer.
|
|
8424
8430
|
* @returns Map of logical ID to resource change
|
|
8425
8431
|
*/
|
|
8426
|
-
async calculateDiff(currentState, desiredTemplate, resolveFn) {
|
|
8432
|
+
async calculateDiff(currentState, desiredTemplate, resolveFn, canonicalizeProperties) {
|
|
8427
8433
|
const changes = /* @__PURE__ */ new Map();
|
|
8428
8434
|
const currentResources = currentState.resources;
|
|
8429
8435
|
const desiredResources = desiredTemplate.Resources;
|
|
@@ -8475,8 +8481,11 @@ var DiffCalculator = class DiffCalculator {
|
|
|
8475
8481
|
this.logger.debug(`UPDATE (Type change): ${logicalId} (${currentResource.resourceType} -> ${desiredResource.Type})`);
|
|
8476
8482
|
} else {
|
|
8477
8483
|
const rawDesiredProps = desiredResource.Properties || {};
|
|
8478
|
-
const
|
|
8479
|
-
const
|
|
8484
|
+
const resolvedDesiredProps = resolveFn ? await this.resolveBestEffort(rawDesiredProps, resolveFn) : rawDesiredProps;
|
|
8485
|
+
const desiredPropsForCompare = canonicalizeProperties ? canonicalizeProperties(desiredResource.Type, resolvedDesiredProps) : resolvedDesiredProps;
|
|
8486
|
+
const currentPropsForCompare = canonicalizeProperties && currentResource.provisionedBy !== "cc-api" ? canonicalizeProperties(desiredResource.Type, currentResource.properties) : currentResource.properties;
|
|
8487
|
+
if (canonicalizeProperties && !this.valuesEqual(desiredPropsForCompare, resolvedDesiredProps)) this.logger.warn(`${logicalId} (${desiredResource.Type}): part of the declared properties cannot be sent as declared and is ignored when comparing against deployed state — the provider narrows them. Fix the template to declare only what the resource supports; until then changes to the ignored keys have no effect.`);
|
|
8488
|
+
const propertyChanges = await this.compareProperties(desiredResource.Type, currentPropsForCompare, desiredPropsForCompare);
|
|
8480
8489
|
const attributeChanges = this.compareAttributes(currentResource, desiredResource);
|
|
8481
8490
|
if (propertyChanges.length > 0 || attributeChanges.length > 0) {
|
|
8482
8491
|
changes.set(logicalId, {
|
|
@@ -12827,7 +12836,7 @@ var CloudControlProvider = class {
|
|
|
12827
12836
|
if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
|
|
12828
12837
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
12829
12838
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
12830
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
12839
|
+
const { ASGProvider } = await import("./asg-provider-Dpx4B6UA.js").then((n) => n.n);
|
|
12831
12840
|
await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
12832
12841
|
return;
|
|
12833
12842
|
}
|
|
@@ -17810,6 +17819,36 @@ function extractDeploymentEventError(err) {
|
|
|
17810
17819
|
return result;
|
|
17811
17820
|
}
|
|
17812
17821
|
|
|
17822
|
+
//#endregion
|
|
17823
|
+
//#region src/provisioning/canonicalize-properties.ts
|
|
17824
|
+
/**
|
|
17825
|
+
* Build the diff-time property normalizer from a provider registry (issue
|
|
17826
|
+
* #1591).
|
|
17827
|
+
*
|
|
17828
|
+
* ONE builder shared by `cdkd deploy` (the engine) and `cdkd diff` (the
|
|
17829
|
+
* command), because the two MUST agree: the diff is the preview of the deploy,
|
|
17830
|
+
* and a preview that narrows differently from the apply forecasts a change the
|
|
17831
|
+
* deploy will never make — the same class of bug as the phantom drift this
|
|
17832
|
+
* issue is about, moved one command over.
|
|
17833
|
+
*
|
|
17834
|
+
* Best-effort by construction. An unregistered type, a provider without the
|
|
17835
|
+
* hook, or a hook that throws all fall back to the properties unchanged — the
|
|
17836
|
+
* pre-#1591 behavior. A comparison refinement must never be able to take down
|
|
17837
|
+
* a deploy or a diff.
|
|
17838
|
+
*/
|
|
17839
|
+
function makeCanonicalizePropertiesFn(registry) {
|
|
17840
|
+
const logger = getLogger().child("canonicalize-properties");
|
|
17841
|
+
return (resourceType, properties) => {
|
|
17842
|
+
try {
|
|
17843
|
+
if (!registry.hasProvider(resourceType)) return properties;
|
|
17844
|
+
return registry.getProvider(resourceType).canonicalizeDesiredProperties?.(resourceType, properties) ?? properties;
|
|
17845
|
+
} catch (error) {
|
|
17846
|
+
logger.debug(`canonicalizeDesiredProperties failed for ${resourceType}: ${error instanceof Error ? error.message : String(error)}`);
|
|
17847
|
+
return properties;
|
|
17848
|
+
}
|
|
17849
|
+
};
|
|
17850
|
+
}
|
|
17851
|
+
|
|
17813
17852
|
//#endregion
|
|
17814
17853
|
//#region src/provisioning/final-snapshot.ts
|
|
17815
17854
|
/**
|
|
@@ -19313,7 +19352,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
19313
19352
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
19314
19353
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
19315
19354
|
function getCdkdVersion() {
|
|
19316
|
-
return "0.280.
|
|
19355
|
+
return "0.280.24";
|
|
19317
19356
|
}
|
|
19318
19357
|
/**
|
|
19319
19358
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -20236,7 +20275,7 @@ var DeployEngine = class {
|
|
|
20236
20275
|
}, stackName);
|
|
20237
20276
|
diffResolverContext.bestEffort = true;
|
|
20238
20277
|
const diffResolveFn = (value) => this.resolver.resolve(value, diffResolverContext);
|
|
20239
|
-
const changes = await this.diffCalculator.calculateDiff(currentState, effectiveTemplate, diffResolveFn);
|
|
20278
|
+
const changes = await this.diffCalculator.calculateDiff(currentState, effectiveTemplate, diffResolveFn, makeCanonicalizePropertiesFn(this.providerRegistry));
|
|
20240
20279
|
if (!this.diffCalculator.hasChanges(changes)) {
|
|
20241
20280
|
this.logger.info("No changes detected. Stack is up to date.");
|
|
20242
20281
|
let persistedOutputs = currentState.outputs ?? {};
|
|
@@ -20933,7 +20972,7 @@ var DeployEngine = class {
|
|
|
20933
20972
|
stateResources[logicalId] = {
|
|
20934
20973
|
physicalId: result.physicalId,
|
|
20935
20974
|
resourceType,
|
|
20936
|
-
properties: resolvedProps,
|
|
20975
|
+
properties: this.propertiesToRecord(resolvedProps, result),
|
|
20937
20976
|
...result.attributes && { attributes: result.attributes },
|
|
20938
20977
|
...dependencies && dependencies.length > 0 && { dependencies },
|
|
20939
20978
|
...templateAttrs,
|
|
@@ -21090,7 +21129,7 @@ var DeployEngine = class {
|
|
|
21090
21129
|
stateResources[logicalId] = {
|
|
21091
21130
|
physicalId: createResult.physicalId,
|
|
21092
21131
|
resourceType,
|
|
21093
|
-
properties: resolvedProps,
|
|
21132
|
+
properties: this.propertiesToRecord(resolvedProps, createResult),
|
|
21094
21133
|
...createResult.attributes && { attributes: createResult.attributes },
|
|
21095
21134
|
...dependencies && dependencies.length > 0 && { dependencies },
|
|
21096
21135
|
...this.extractTemplateAttributes(template, logicalId),
|
|
@@ -21144,11 +21183,13 @@ var DeployEngine = class {
|
|
|
21144
21183
|
const replProvider = replDecision.provider;
|
|
21145
21184
|
const replProps = replDecision.provisionedBy === "cc-api" ? this.preparePropertiesForCcApi(resourceType, resolvedProps, logicalId) : resolvedProps;
|
|
21146
21185
|
const createResult = await this.withRetry(() => replProvider.create(logicalId, resourceType, replProps), logicalId, void 0, void 0, replProvider);
|
|
21147
|
-
|
|
21186
|
+
const replacementResult = {
|
|
21148
21187
|
physicalId: createResult.physicalId,
|
|
21149
|
-
|
|
21150
|
-
|
|
21188
|
+
wasReplaced: true,
|
|
21189
|
+
...createResult.attributes && { attributes: createResult.attributes }
|
|
21151
21190
|
};
|
|
21191
|
+
if (createResult.effectiveProperties) replacementResult.effectiveProperties = createResult.effectiveProperties;
|
|
21192
|
+
result = replacementResult;
|
|
21152
21193
|
resultProvisionedBy = replDecision.provisionedBy;
|
|
21153
21194
|
} else throw updateError;
|
|
21154
21195
|
}
|
|
@@ -21157,7 +21198,7 @@ var DeployEngine = class {
|
|
|
21157
21198
|
stateResources[logicalId] = {
|
|
21158
21199
|
physicalId: result.physicalId,
|
|
21159
21200
|
resourceType,
|
|
21160
|
-
properties: resolvedProps,
|
|
21201
|
+
properties: this.propertiesToRecord(resolvedProps, result),
|
|
21161
21202
|
...carriedAttributes && { attributes: carriedAttributes },
|
|
21162
21203
|
...dependencies && dependencies.length > 0 && { dependencies },
|
|
21163
21204
|
...this.extractTemplateAttributes(template, logicalId),
|
|
@@ -21237,6 +21278,25 @@ var DeployEngine = class {
|
|
|
21237
21278
|
return deps.length > 0 ? deps : void 0;
|
|
21238
21279
|
}
|
|
21239
21280
|
/**
|
|
21281
|
+
* The properties to RECORD in cdkd state for a just-provisioned resource.
|
|
21282
|
+
*
|
|
21283
|
+
* Normally the DESIRED (resolved) bag: state is the record of what the user
|
|
21284
|
+
* asked for, and the #1160 absent-field removal derivation reads it as the
|
|
21285
|
+
* previous side on the next deploy, so it must stay template-shaped.
|
|
21286
|
+
*
|
|
21287
|
+
* A provider may override it by returning `effectiveProperties` when it
|
|
21288
|
+
* deliberately NARROWED what it sent (issue #1591). Recording the desired
|
|
21289
|
+
* bag there would describe something AWS does not hold, and since
|
|
21290
|
+
* `readCurrentState` can only return what AWS does hold, the difference is
|
|
21291
|
+
* PERMANENT phantom drift — reported by every `cdkd drift`, and "repaired"
|
|
21292
|
+
* by `drift --revert` into another `update()` that narrows and re-reports.
|
|
21293
|
+
* The provider is the only layer that knows what it dropped, so it says so
|
|
21294
|
+
* and the engine records that instead.
|
|
21295
|
+
*/
|
|
21296
|
+
propertiesToRecord(desiredProperties, result) {
|
|
21297
|
+
return result.effectiveProperties ?? desiredProperties;
|
|
21298
|
+
}
|
|
21299
|
+
/**
|
|
21240
21300
|
* Read `DeletionPolicy` / `UpdateReplacePolicy` from the synth template
|
|
21241
21301
|
* so they can be persisted in `ResourceState` (schema v5+). Always returns
|
|
21242
21302
|
* both keys (`undefined` when the template does not carry the attribute)
|
|
@@ -21424,5 +21484,5 @@ var DeployEngine = class {
|
|
|
21424
21484
|
};
|
|
21425
21485
|
|
|
21426
21486
|
//#endregion
|
|
21427
|
-
export {
|
|
21428
|
-
//# sourceMappingURL=deploy-engine-
|
|
21487
|
+
export { requireConfigObject as $, AssemblyReader as $t, green as A, __exportAll as An, runDockerForeground as At, disableInstanceApiTermination as B, resolveCaptureObservedState as Bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as C, StackTerminationProtectionError as Cn, getBootstrapMarkerKey as Ct, bold as D, isCdkdError as Dn, buildDockerImage as Dt, formatResourceLine as E, formatError as En, validateContainerRepoName as Et, clearOnUpdateRemoval as F, synthesisStatusMessage as Ft, WAFv2WebACLProvider as G, stateBucketExistenceConfirmed as Gt, IntrinsicFunctionResolver as H, resolveStateBucketWithDefault as Ht, ProviderRegistry as I, getDefaultStateBucketName as It, assertRegionMatch as J, CFN_TEMPLATE_URL_LIMIT as Jt, normalizeAwsTagsToCfn as K, warnDeprecatedNoPrefixCliFlag as Kt, findActionableSilentDrops as L, getLegacyStateBucketName as Lt, yellow as M, AssetManifestLoader as Mt, IAMRoleProvider as N, getDockerImageBySourceHash as Nt, cyan as O, normalizeAwsError as On, formatDockerLoginError as Ot, collectInlinePolicyNamesManagedBySiblings as P, Synthesizer as Pt, requireConfigArray as Q, expectedOwnerParam as Qt, CloudControlProvider as R, resolveApp as Rt, extractDeploymentEventError as S, StackHasActiveImportsError as Sn, ensureAssetStorage as St, renderStatefulReason as T, SynthesisError as Tn, validateAssetBucketName as Tt, cfnRefValueFromPhysicalId as U, resolveStateBucketWithDefaultAndSource as Ut, isTerminationProtectionPropagationError as V, resolveSkipPrefix as Vt, refStateLookupFromResource as W, resolveUseCdkBootstrapAssets as Wt, readConfigString as X, findLargeInlineResources as Xt, configStringRefusal as Y, MIGRATE_TMP_PREFIX as Yt, replayWarn as Z, uploadCfnTemplate as Zt, createPreDeleteFinalSnapshot as _, NestedStackChildDirectDestroyError as _n, createAssetRedirectResolver as _t, DeploymentEventsStore as a, resetAwsClients as an, isRetryableTransientError as at, unsupportedFinalSnapshotError as b, ResourceTimeoutError as bn, AssetModeResolver as bt, replayFailedOperations as c, CdkdError as cn, TemplateParser as ct, IMPLICIT_DELETE_DEPENDENCIES as d, DeployCancelledError as dn, rebuildClientForBucketRegion as dt, processStackMessages as en, requireConfigString as et, computeImplicitDeleteEdges as f, LocalInvokeBuildError as fn, shouldRetainResource as ft, ccRoutedFinalSnapshotError as g, MissingCdkCliError as gn, buildAssetRedirectMap as gt, buildFinalSnapshotIdentifier as h, LockError as hn, WorkGraph as ht, DeploymentEventsReader as i, getAwsClients as in, withRetry as it, red as j, runDockerStreaming as jt, gray as k, withErrorHandling as kn, getDockerCmd as kt, replayRollback as l, ConfigError as ln, LockManager as lt, PRE_DELETE_SNAPSHOT_TYPES as m, LocalStartServiceError as mn, stringifyValue as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, resolveBucketRegion as nn, DiffCalculator as nt, planFailedOps as o, setAwsClients as on, isThrottlingError as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, LocalMigrateError as pn, AssetPublisher as pt, resolveExplicitPhysicalId as q, CFN_TEMPLATE_BODY_LIMIT as qt, DeployEngine as r, AwsClients as rn, describeTypeWithThrottleRetry as rt, planRollback as s, AssetError as sn, DagBuilder as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, clearBucketRegionCache as tn, applyRoleArnIfSet as tt, withResourceDeadline as u, DependencyError as un, S3StateBackend as ut, isFinalSnapshotError as v, PartialFailureError as vn, loadPublishableAssetManifest as vt, isStatefulRecreateTargetSync as w, StateError as wn, parseBootstrapMarker as wt, makeCanonicalizePropertiesFn as x, ResourceUpdateNotSupportedError as xn, BOOTSTRAP_MARKER_PREFIX as xt, refusesFinalSnapshot as y, ProvisioningError as yn, rewriteTemplateAssetReferences as yt, slowCcOperationTimeoutMs as z, resolveAutoAssetStorage as zt };
|
|
21488
|
+
//# sourceMappingURL=deploy-engine-60FIug-P.js.map
|