@go-to-k/cdkd 0.276.3 → 0.276.4
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-DFSI7iBe.js → asg-provider-xUGPo-HF.js} +2 -2
- package/dist/{asg-provider-DFSI7iBe.js.map → asg-provider-xUGPo-HF.js.map} +1 -1
- package/dist/cli.js +19 -5
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-gQzltBso.js → deploy-engine-us-U4a0a.js} +73 -23
- package/dist/{deploy-engine-gQzltBso.js.map → deploy-engine-us-U4a0a.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -12090,7 +12090,7 @@ var CloudControlProvider = class {
|
|
|
12090
12090
|
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);
|
|
12091
12091
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
12092
12092
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
12093
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
12093
|
+
const { ASGProvider } = await import("./asg-provider-xUGPo-HF.js").then((n) => n.n);
|
|
12094
12094
|
await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
12095
12095
|
return;
|
|
12096
12096
|
}
|
|
@@ -17128,6 +17128,34 @@ const PRE_DELETE_SNAPSHOT_TYPES = /* @__PURE__ */ new Set([
|
|
|
17128
17128
|
"AWS::Redshift::Cluster",
|
|
17129
17129
|
"AWS::ElastiCache::ReplicationGroup"
|
|
17130
17130
|
]);
|
|
17131
|
+
/**
|
|
17132
|
+
* The mechanism matrix as a PURE function of (type, route) — issue #1366.
|
|
17133
|
+
*
|
|
17134
|
+
* Extracted so the executor that ACTS on it and the plan preview that
|
|
17135
|
+
* DESCRIBES it read one source: the preview used to promise "final snapshot,
|
|
17136
|
+
* then delete" for every Snapshot-policy resource, including the shapes the
|
|
17137
|
+
* replay was about to refuse. Deciding this in the CLI's label layer rather
|
|
17138
|
+
* than in the pure classifier is deliberate — whether a refusal actually
|
|
17139
|
+
* happens ALSO depends on `--skip-final-snapshot`, a flag the classifier
|
|
17140
|
+
* cannot see, and the label functions take it.
|
|
17141
|
+
*
|
|
17142
|
+
* `provisionedBy` must be the route the DELETE will take (state record first,
|
|
17143
|
+
* journaled op as the legacy fallback), not merely the op's recorded one —
|
|
17144
|
+
* a gate judging a different route than the delete uses is worse than none.
|
|
17145
|
+
*/
|
|
17146
|
+
function finalSnapshotMechanism(resourceType, provisionedBy) {
|
|
17147
|
+
if (ATOMIC_FINAL_SNAPSHOT_TYPES.has(resourceType)) return provisionedBy === "cc-api" ? "refuse-cc-routed" : "atomic-delete-parameter";
|
|
17148
|
+
if (PRE_DELETE_SNAPSHOT_TYPES.has(resourceType)) return "pre-delete-snapshot";
|
|
17149
|
+
return "refuse-unsupported-type";
|
|
17150
|
+
}
|
|
17151
|
+
/**
|
|
17152
|
+
* Will a `Snapshot`-policy delete of this (type, route) be REFUSED rather
|
|
17153
|
+
* than carried out? The plan preview's question (issue #1366).
|
|
17154
|
+
*/
|
|
17155
|
+
function refusesFinalSnapshot(resourceType, provisionedBy) {
|
|
17156
|
+
const mechanism = finalSnapshotMechanism(resourceType, provisionedBy);
|
|
17157
|
+
return mechanism === "refuse-cc-routed" || mechanism === "refuse-unsupported-type";
|
|
17158
|
+
}
|
|
17131
17159
|
/** Sanitize a physical id into the snapshot-identifier charset (shared by the
|
|
17132
17160
|
* identifier builder and the pre-delete reuse-probe prefix match). */
|
|
17133
17161
|
function sanitizeSnapshotBase(physicalId) {
|
|
@@ -17811,15 +17839,14 @@ function rollbackFinalSnapshotId(resourceType, record, fallbackProvisionedBy) {
|
|
|
17811
17839
|
async function prepareCreateRollbackFinalSnapshot(op, provisionedBy, ctx) {
|
|
17812
17840
|
const { logicalId, resourceType } = op;
|
|
17813
17841
|
const physicalId = op.physicalId;
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
|
|
17819
|
-
|
|
17820
|
-
|
|
17842
|
+
switch (finalSnapshotMechanism(resourceType, provisionedBy)) {
|
|
17843
|
+
case "atomic-delete-parameter": return buildFinalSnapshotIdentifier(physicalId, resourceType);
|
|
17844
|
+
case "pre-delete-snapshot":
|
|
17845
|
+
await createPreDeleteFinalSnapshot(resourceType, physicalId, logicalId, ctx.finalSnapshotClients ?? getAwsClients(), ctx.logger);
|
|
17846
|
+
return;
|
|
17847
|
+
case "refuse-cc-routed": throw ccRoutedFinalSnapshotError(logicalId, resourceType, SKIP_FINAL_SNAPSHOT_FLAG);
|
|
17848
|
+
case "refuse-unsupported-type": throw unsupportedFinalSnapshotError(logicalId, resourceType, SKIP_FINAL_SNAPSHOT_FLAG);
|
|
17821
17849
|
}
|
|
17822
|
-
throw unsupportedFinalSnapshotError(logicalId, resourceType, SKIP_FINAL_SNAPSHOT_FLAG);
|
|
17823
17850
|
}
|
|
17824
17851
|
/**
|
|
17825
17852
|
* Retry schedule for a re-create that must wait out a name-release delay:
|
|
@@ -17915,7 +17942,8 @@ function classifyFailedOp(op, stateResources) {
|
|
|
17915
17942
|
function planFailedOps(failedOps, stateResources) {
|
|
17916
17943
|
return failedOps.map((op) => ({
|
|
17917
17944
|
op,
|
|
17918
|
-
action: classifyFailedOp(op, stateResources)
|
|
17945
|
+
action: classifyFailedOp(op, stateResources),
|
|
17946
|
+
effectiveProvisionedBy: effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy)
|
|
17919
17947
|
}));
|
|
17920
17948
|
}
|
|
17921
17949
|
/**
|
|
@@ -17928,7 +17956,8 @@ function planRollback(operations, stateResources, orphanLogicalIds = /* @__PURE_
|
|
|
17928
17956
|
return [...[...otherOps].reverse(), ...sortRollbackCreates(createOps, stateResources)].map((op) => ({
|
|
17929
17957
|
op,
|
|
17930
17958
|
action: classifyRollbackOp(op, stateResources, orphanLogicalIds),
|
|
17931
|
-
replacement: isReplacementOp(op)
|
|
17959
|
+
replacement: isReplacementOp(op),
|
|
17960
|
+
effectiveProvisionedBy: effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy)
|
|
17932
17961
|
}));
|
|
17933
17962
|
}
|
|
17934
17963
|
function partitionOps(operations) {
|
|
@@ -17998,6 +18027,14 @@ async function replayRollback(operations, stateResources, stackName, ctx, option
|
|
|
17998
18027
|
async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds, result, afterOp, isInterrupted) {
|
|
17999
18028
|
const action = classifyRollbackOp(op, stateResources, orphanLogicalIds);
|
|
18000
18029
|
const { logger } = ctx;
|
|
18030
|
+
/**
|
|
18031
|
+
* The route a CREATE-rollback arm resolved for this op (issue #1366) —
|
|
18032
|
+
* hoisted so the shared catch's ROLLBACK_RESOURCE_FAILED reports the route
|
|
18033
|
+
* the delete was going to take, which is the one a refusal is about. Stays
|
|
18034
|
+
* `undefined` on the UPDATE / replacement arms, where the catch keeps the
|
|
18035
|
+
* journaled value (those arms resolve their own routing separately).
|
|
18036
|
+
*/
|
|
18037
|
+
let createRollbackRoute;
|
|
18001
18038
|
try {
|
|
18002
18039
|
switch (action) {
|
|
18003
18040
|
case "unrecoverable-delete":
|
|
@@ -18017,6 +18054,8 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18017
18054
|
return;
|
|
18018
18055
|
case "orphan-flag":
|
|
18019
18056
|
if (op.changeType === "CREATE") {
|
|
18057
|
+
const orphanFlagProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
18058
|
+
createRollbackRoute = orphanFlagProvisionedBy;
|
|
18020
18059
|
delete stateResources[op.logicalId];
|
|
18021
18060
|
logger.info(` Rollback: Orphaning created resource ${op.logicalId} (--orphan)`);
|
|
18022
18061
|
await afterOp?.(op.logicalId);
|
|
@@ -18026,11 +18065,13 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18026
18065
|
operation: "CREATE",
|
|
18027
18066
|
logicalId: op.logicalId,
|
|
18028
18067
|
resourceType: op.resourceType,
|
|
18029
|
-
...
|
|
18068
|
+
...orphanFlagProvisionedBy && { provisionedBy: orphanFlagProvisionedBy }
|
|
18030
18069
|
});
|
|
18031
18070
|
} else logger.info(` Rollback: Leaving ${op.logicalId} at its new state (--orphan)`);
|
|
18032
18071
|
return;
|
|
18033
|
-
case "orphan-retain":
|
|
18072
|
+
case "orphan-retain": {
|
|
18073
|
+
const orphanProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
18074
|
+
createRollbackRoute = orphanProvisionedBy;
|
|
18034
18075
|
delete stateResources[op.logicalId];
|
|
18035
18076
|
logger.info(` Rollback: Leaving ${op.logicalId} (${op.resourceType}) in AWS (DeletionPolicy: Retain) — removed from state`);
|
|
18036
18077
|
await afterOp?.(op.logicalId);
|
|
@@ -18040,9 +18081,10 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18040
18081
|
operation: "CREATE",
|
|
18041
18082
|
logicalId: op.logicalId,
|
|
18042
18083
|
resourceType: op.resourceType,
|
|
18043
|
-
...
|
|
18084
|
+
...orphanProvisionedBy && { provisionedBy: orphanProvisionedBy }
|
|
18044
18085
|
});
|
|
18045
18086
|
return;
|
|
18087
|
+
}
|
|
18046
18088
|
case "delete":
|
|
18047
18089
|
case "delete-with-final-snapshot": {
|
|
18048
18090
|
if (!op.physicalId) {
|
|
@@ -18051,6 +18093,7 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18051
18093
|
return;
|
|
18052
18094
|
}
|
|
18053
18095
|
const deleteProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
18096
|
+
createRollbackRoute = deleteProvisionedBy;
|
|
18054
18097
|
const snapshotPolicy = action === "delete-with-final-snapshot";
|
|
18055
18098
|
const takeFinalSnapshot = snapshotPolicy && ctx.skipFinalSnapshot !== true;
|
|
18056
18099
|
let finalSnapshotIdentifier;
|
|
@@ -18073,7 +18116,7 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18073
18116
|
operation: "CREATE",
|
|
18074
18117
|
logicalId: op.logicalId,
|
|
18075
18118
|
resourceType: op.resourceType,
|
|
18076
|
-
...
|
|
18119
|
+
...deleteProvisionedBy && { provisionedBy: deleteProvisionedBy }
|
|
18077
18120
|
});
|
|
18078
18121
|
return;
|
|
18079
18122
|
}
|
|
@@ -18226,13 +18269,14 @@ async function replaySingle(op, stateResources, stackName, ctx, orphanLogicalIds
|
|
|
18226
18269
|
logger.warn(` Rollback failed for ${op.logicalId} (${op.changeType}): ${rollbackError instanceof Error ? rollbackError.message : String(rollbackError)}`);
|
|
18227
18270
|
logger.warn(" Continuing with remaining rollback operations...");
|
|
18228
18271
|
result.failures++;
|
|
18272
|
+
const failedRoute = createRollbackRoute ?? op.provisionedBy;
|
|
18229
18273
|
ctx.recordEvent?.({
|
|
18230
18274
|
eventType: "ROLLBACK_RESOURCE_FAILED",
|
|
18231
18275
|
stackName,
|
|
18232
18276
|
operation: op.changeType,
|
|
18233
18277
|
logicalId: op.logicalId,
|
|
18234
18278
|
resourceType: op.resourceType,
|
|
18235
|
-
...
|
|
18279
|
+
...failedRoute && { provisionedBy: failedRoute },
|
|
18236
18280
|
error: extractDeploymentEventError(rollbackError)
|
|
18237
18281
|
});
|
|
18238
18282
|
}
|
|
@@ -18269,6 +18313,7 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
|
|
|
18269
18313
|
}
|
|
18270
18314
|
const op = failedOps[i];
|
|
18271
18315
|
const action = classifyFailedOp(op, stateResources);
|
|
18316
|
+
let createRollbackRoute;
|
|
18272
18317
|
try {
|
|
18273
18318
|
switch (action) {
|
|
18274
18319
|
case "skip-failed-noop":
|
|
@@ -18282,7 +18327,9 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
|
|
|
18282
18327
|
logger.warn(` Rollback: cannot revert failed UPDATE of ${op.logicalId} — no previous state available, skipping`);
|
|
18283
18328
|
result.warnings++;
|
|
18284
18329
|
break;
|
|
18285
|
-
case "orphan-failed-create-retain":
|
|
18330
|
+
case "orphan-failed-create-retain": {
|
|
18331
|
+
const orphanProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
18332
|
+
createRollbackRoute = orphanProvisionedBy;
|
|
18286
18333
|
delete stateResources[op.logicalId];
|
|
18287
18334
|
logger.info(` Rollback: leaving partially-created ${op.logicalId} (${op.resourceType}) in AWS (DeletionPolicy: Retain) — removed from state`);
|
|
18288
18335
|
await options.afterOp?.(op.logicalId);
|
|
@@ -18292,12 +18339,14 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
|
|
|
18292
18339
|
operation: "CREATE",
|
|
18293
18340
|
logicalId: op.logicalId,
|
|
18294
18341
|
resourceType: op.resourceType,
|
|
18295
|
-
...
|
|
18342
|
+
...orphanProvisionedBy && { provisionedBy: orphanProvisionedBy }
|
|
18296
18343
|
});
|
|
18297
18344
|
break;
|
|
18345
|
+
}
|
|
18298
18346
|
case "delete-failed-create":
|
|
18299
18347
|
case "delete-failed-create-with-final-snapshot": {
|
|
18300
18348
|
const deleteProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
18349
|
+
createRollbackRoute = deleteProvisionedBy;
|
|
18301
18350
|
const snapshotPolicy = action === "delete-failed-create-with-final-snapshot";
|
|
18302
18351
|
const takeFinalSnapshot = snapshotPolicy && ctx.skipFinalSnapshot !== true;
|
|
18303
18352
|
let finalSnapshotIdentifier;
|
|
@@ -18319,7 +18368,7 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
|
|
|
18319
18368
|
operation: "CREATE",
|
|
18320
18369
|
logicalId: op.logicalId,
|
|
18321
18370
|
resourceType: op.resourceType,
|
|
18322
|
-
...
|
|
18371
|
+
...deleteProvisionedBy && { provisionedBy: deleteProvisionedBy }
|
|
18323
18372
|
});
|
|
18324
18373
|
break;
|
|
18325
18374
|
}
|
|
@@ -18350,13 +18399,14 @@ async function replayFailedOperations(failedOps, stateResources, stackName, ctx,
|
|
|
18350
18399
|
logger.warn(` Rollback failed for failed-op ${op.logicalId} (${op.changeType}): ${revertError instanceof Error ? revertError.message : String(revertError)}`);
|
|
18351
18400
|
result.failures++;
|
|
18352
18401
|
pending.add(op);
|
|
18402
|
+
const failedRoute = createRollbackRoute ?? op.provisionedBy;
|
|
18353
18403
|
ctx.recordEvent?.({
|
|
18354
18404
|
eventType: "ROLLBACK_RESOURCE_FAILED",
|
|
18355
18405
|
stackName,
|
|
18356
18406
|
operation: op.changeType,
|
|
18357
18407
|
logicalId: op.logicalId,
|
|
18358
18408
|
resourceType: op.resourceType,
|
|
18359
|
-
...
|
|
18409
|
+
...failedRoute && { provisionedBy: failedRoute },
|
|
18360
18410
|
error: extractDeploymentEventError(revertError)
|
|
18361
18411
|
});
|
|
18362
18412
|
}
|
|
@@ -18457,7 +18507,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
18457
18507
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
18458
18508
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
18459
18509
|
function getCdkdVersion() {
|
|
18460
|
-
return "0.276.
|
|
18510
|
+
return "0.276.4";
|
|
18461
18511
|
}
|
|
18462
18512
|
/**
|
|
18463
18513
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -20568,5 +20618,5 @@ var DeployEngine = class {
|
|
|
20568
20618
|
};
|
|
20569
20619
|
|
|
20570
20620
|
//#endregion
|
|
20571
|
-
export {
|
|
20572
|
-
//# sourceMappingURL=deploy-engine-
|
|
20621
|
+
export { DagBuilder as $, AssetError as $t, red as A, resolveApp as At, isTerminationProtectionPropagationError as B, CFN_TEMPLATE_URL_LIMIT as Bt, isStatefulRecreateTargetSync as C, runDockerStreaming as Ct, cyan as D, synthesisStatusMessage as Dt, bold as E, Synthesizer as Et, ProviderRegistry as F, resolveStateBucketWithDefaultAndSource as Ft, normalizeAwsTagsToCfn as G, AssemblyReader as Gt, cfnRefValueFromPhysicalId as H, findLargeInlineResources as Ht, findActionableSilentDrops as I, resolveUseCdkBootstrapAssets as It, applyRoleArnIfSet as J, resolveBucketRegion as Jt, resolveExplicitPhysicalId as K, processStackMessages as Kt, CloudControlProvider as L, stateBucketExistenceConfirmed as Lt, IAMRoleProvider as M, resolveCaptureObservedState as Mt, collectInlinePolicyNamesManagedBySiblings as N, resolveSkipPrefix as Nt, gray as O, getDefaultStateBucketName as Ot, clearOnUpdateRemoval as P, resolveStateBucketWithDefault as Pt, isRetryableTransientError as Q, setAwsClients as Qt, slowCcOperationTimeoutMs as R, warnDeprecatedNoPrefixCliFlag as Rt, MULTI_REGION_RECREATE_BLOCKED_TYPES as S, __exportAll as Sn, runDockerForeground as St, formatResourceLine as T, getDockerImageBySourceHash as Tt, refStateLookupFromResource as U, uploadCfnTemplate as Ut, IntrinsicFunctionResolver as V, MIGRATE_TMP_PREFIX as Vt, WAFv2WebACLProvider as W, expectedOwnerParam as Wt, describeTypeWithThrottleRetry as X, getAwsClients as Xt, DiffCalculator as Y, AwsClients as Yt, withRetry as Z, resetAwsClients as Zt, createPreDeleteFinalSnapshot as _, SynthesisError as _n, validateAssetBucketName as _t, DeploymentEventsStore as a, LocalMigrateError as an, AssetPublisher as at, unsupportedFinalSnapshotError as b, normalizeAwsError as bn, formatDockerLoginError as bt, replayFailedOperations as c, MissingCdkCliError as cn, buildAssetRedirectMap as ct, IMPLICIT_DELETE_DEPENDENCIES as d, ProvisioningError as dn, rewriteTemplateAssetReferences as dt, CdkdError as en, TemplateParser as et, computeImplicitDeleteEdges as f, ResourceTimeoutError as fn, AssetModeResolver as ft, ccRoutedFinalSnapshotError as g, StateError as gn, parseBootstrapMarker as gt, buildFinalSnapshotIdentifier as h, StackTerminationProtectionError as hn, getBootstrapMarkerKey as ht, DeploymentEventsReader as i, LocalInvokeBuildError as in, shouldRetainResource as it, yellow as j, resolveAutoAssetStorage as jt, green as k, getLegacyStateBucketName as kt, replayRollback as l, NestedStackChildDirectDestroyError as ln, createAssetRedirectResolver as lt, PRE_DELETE_SNAPSHOT_TYPES as m, StackHasActiveImportsError as mn, ensureAssetStorage as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, DependencyError as nn, S3StateBackend as nt, planFailedOps as o, LocalStartServiceError as on, stringifyValue as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, ResourceUpdateNotSupportedError as pn, BOOTSTRAP_MARKER_PREFIX as pt, assertRegionMatch as q, clearBucketRegionCache as qt, DeployEngine as r, DeployCancelledError as rn, rebuildClientForBucketRegion as rt, planRollback as s, LockError as sn, WorkGraph as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, ConfigError as tn, LockManager as tt, withResourceDeadline as u, PartialFailureError as un, loadPublishableAssetManifest as ut, isFinalSnapshotError as v, formatError as vn, validateContainerRepoName as vt, renderStatefulReason as w, AssetManifestLoader as wt, extractDeploymentEventError as x, withErrorHandling as xn, getDockerCmd as xt, refusesFinalSnapshot as y, isCdkdError as yn, buildDockerImage as yt, disableInstanceApiTermination as z, CFN_TEMPLATE_BODY_LIMIT as zt };
|
|
20622
|
+
//# sourceMappingURL=deploy-engine-us-U4a0a.js.map
|