@go-to-k/cdkd 0.267.4 → 0.267.6
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-C8yQ0Br2.js → asg-provider-D5GSbDk-.js} +2 -2
- package/dist/{asg-provider-C8yQ0Br2.js.map → asg-provider-D5GSbDk-.js.map} +1 -1
- package/dist/cli.js +5 -8
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-DYrhAO-0.js → deploy-engine-COX8YJsC.js} +48 -26
- package/dist/deploy-engine-COX8YJsC.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-DYrhAO-0.js.map +0 -1
|
@@ -7733,9 +7733,13 @@ const MAX_THROTTLE_RETRIES = 4;
|
|
|
7733
7733
|
* Issue `DescribeType` for a resource type, retrying throttle-shaped failures
|
|
7734
7734
|
* with exponential backoff. Any other failure (or a throttle persisting past
|
|
7735
7735
|
* the retry budget) is thrown to the caller unchanged.
|
|
7736
|
+
*
|
|
7737
|
+
* `client` defaults to the shared `AwsClients.cloudFormation`; callers that
|
|
7738
|
+
* carry their own injected client (`cdkd export`'s primary-identifier
|
|
7739
|
+
* resolution) pass it so test doubles keep intercepting.
|
|
7736
7740
|
*/
|
|
7737
|
-
function describeTypeWithThrottleRetry(resourceType) {
|
|
7738
|
-
return withRetry(() => getAwsClients().cloudFormation.send(new DescribeTypeCommand({
|
|
7741
|
+
function describeTypeWithThrottleRetry(resourceType, client) {
|
|
7742
|
+
return withRetry(() => (client ?? getAwsClients().cloudFormation).send(new DescribeTypeCommand({
|
|
7739
7743
|
Type: "RESOURCE",
|
|
7740
7744
|
TypeName: resourceType
|
|
7741
7745
|
})), resourceType, {
|
|
@@ -11608,7 +11612,7 @@ var CloudControlProvider = class {
|
|
|
11608
11612
|
this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
|
|
11609
11613
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
11610
11614
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
11611
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
11615
|
+
const { ASGProvider } = await import("./asg-provider-D5GSbDk-.js").then((n) => n.n);
|
|
11612
11616
|
await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
11613
11617
|
return;
|
|
11614
11618
|
}
|
|
@@ -17311,7 +17315,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
17311
17315
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
17312
17316
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
17313
17317
|
function getCdkdVersion() {
|
|
17314
|
-
return "0.267.
|
|
17318
|
+
return "0.267.6";
|
|
17315
17319
|
}
|
|
17316
17320
|
/**
|
|
17317
17321
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -18790,6 +18794,35 @@ var DeployEngine = class {
|
|
|
18790
18794
|
throw new ProvisioningError(`Unrewritten asset reference on '${logicalId}' (${resourceType}): this region uses cdkd-owned asset storage, but the following resolved properties still point at the CDK bootstrap storage that 'cdk gc' may garbage-collect:\n${findings.map((f) => ` - ${f.path}: still references '${f.source}'`).join("\n")}\nThis is a template shape cdkd's asset-reference rewrite did not cover — deploying it would split-brain the stack (assets in cdkd storage, properties reading the CDK bucket). Please report this at https://github.com/go-to-k/cdkd/issues with the property shape. Workaround: deploy with --use-cdk-bootstrap-assets to pin the legacy destinations for this app.`, resourceType, logicalId);
|
|
18791
18795
|
}
|
|
18792
18796
|
/**
|
|
18797
|
+
* `--replace` delete-first fallback for a property-driven replacement of a
|
|
18798
|
+
* custom-named resource: delete the old name holder, then re-create it
|
|
18799
|
+
* under the same name. Shared by the create-first collision catch (issue
|
|
18800
|
+
* #960 follow-up) and the name-idempotent same-id guard (issue #1238) so
|
|
18801
|
+
* the two --replace escape hatches cannot drift apart.
|
|
18802
|
+
*/
|
|
18803
|
+
async replaceDeleteFirstAndRecreate(logicalId, resourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps) {
|
|
18804
|
+
try {
|
|
18805
|
+
await oldDeleteProvider.delete(logicalId, currentResource.physicalId, resourceType, currentResource.properties, { expectedRegion: this.stackRegion });
|
|
18806
|
+
} catch (deleteError) {
|
|
18807
|
+
throw new Error(`Failed to delete old resource ${logicalId} (${currentResource.physicalId}) during the --replace delete-first fallback: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`);
|
|
18808
|
+
}
|
|
18809
|
+
this.logger.info(` ${green("✓")} Old resource deleted`);
|
|
18810
|
+
this.logger.info(` Re-creating ${logicalId}...`);
|
|
18811
|
+
try {
|
|
18812
|
+
return await withRetry(() => this.withRetry(() => replaceProvider.create(logicalId, resourceType, replaceProps), logicalId, void 0, void 0, replaceProvider), logicalId, {
|
|
18813
|
+
maxRetries: 8,
|
|
18814
|
+
initialDelayMs: 2e3,
|
|
18815
|
+
maxDelayMs: 1e4,
|
|
18816
|
+
logger: this.logger,
|
|
18817
|
+
isInterrupted: () => this.interrupted,
|
|
18818
|
+
onInterrupted: () => new InterruptedError(this.interruptCause ?? "user"),
|
|
18819
|
+
isRetryable: isRecreateRetryableError
|
|
18820
|
+
});
|
|
18821
|
+
} catch (recreateError) {
|
|
18822
|
+
throw new Error(`Failed to re-create ${logicalId} after the --replace delete-first fallback already deleted the old resource (${currentResource.physicalId}): ${recreateError instanceof Error ? recreateError.message : String(recreateError)}. Re-run the deploy to create it fresh.`);
|
|
18823
|
+
}
|
|
18824
|
+
}
|
|
18825
|
+
/**
|
|
18793
18826
|
* Inner body of provisionResource, extracted so the outer wrapper can
|
|
18794
18827
|
* apply the per-resource deadline (`withResourceDeadline`) without
|
|
18795
18828
|
* having the timeout / warn timer code dwarf the real provisioning
|
|
@@ -18926,6 +18959,7 @@ var DeployEngine = class {
|
|
|
18926
18959
|
onInterrupted: () => new InterruptedError(this.interruptCause ?? "user"),
|
|
18927
18960
|
isRetryable: isRecreateRetryableError
|
|
18928
18961
|
});
|
|
18962
|
+
if (updateReplacePolicy === "Retain" && createResult.physicalId === currentResource.physicalId) throw new CdkdError(`${logicalId} (${resourceType}) recreate returned the existing resource (${currentResource.physicalId}) instead of creating a new one — its Create API is name-idempotent — and UpdateReplacePolicy: Retain means the old resource was never destroyed, so the new properties were not applied. Rename the resource in your CDK code (or remove the explicit physical name) so the recreate can produce a genuinely new resource.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
|
|
18929
18963
|
} else {
|
|
18930
18964
|
this.logger.info(` Creating new ${logicalId}...`);
|
|
18931
18965
|
let deletedOldFirst = false;
|
|
@@ -18937,27 +18971,15 @@ var DeployEngine = class {
|
|
|
18937
18971
|
if (updateReplacePolicy === "Retain") throw new CdkdError(`${logicalId} (${resourceType}) requires replacement, but its user-supplied physical name is still held by the existing resource AND UpdateReplacePolicy: Retain pins that resource in place. Rename the resource in your CDK code — with Retain, the old resource keeps the name, so a same-name replacement can never proceed.`, "NAMED_REPLACEMENT_COLLISION");
|
|
18938
18972
|
if (this.options.replace !== true) throw new CdkdError(`${logicalId} (${resourceType}) requires replacement, but the create-first attempt collided with the existing resource: ${createMsg}. The resource has a user-supplied physical name, so the CloudFormation-style safe replacement order (create the new resource before deleting the old) cannot reuse the occupied name — CloudFormation refuses this shape with "cannot update a stack when a custom-named resource requires replacing". Either rename the resource in your CDK code (a fresh name lets the safe create-first order proceed), or re-run with \`cdkd deploy --replace\` to delete the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated).`, "NAMED_REPLACEMENT_COLLISION");
|
|
18939
18973
|
this.logger.info(` Create-first collided with the custom-named resource and --replace is set — deleting old ${logicalId} (${currentResource.physicalId}) first...`);
|
|
18940
|
-
try {
|
|
18941
|
-
await oldDeleteProvider.delete(logicalId, currentResource.physicalId, resourceType, currentResource.properties, { expectedRegion: this.stackRegion });
|
|
18942
|
-
} catch (deleteError) {
|
|
18943
|
-
throw new Error(`Failed to delete old resource ${logicalId} (${currentResource.physicalId}) during the --replace delete-first fallback: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`);
|
|
18944
|
-
}
|
|
18945
|
-
this.logger.info(` ${green("✓")} Old resource deleted`);
|
|
18946
18974
|
deletedOldFirst = true;
|
|
18947
|
-
this.
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
18954
|
-
|
|
18955
|
-
onInterrupted: () => new InterruptedError(this.interruptCause ?? "user"),
|
|
18956
|
-
isRetryable: isRecreateRetryableError
|
|
18957
|
-
});
|
|
18958
|
-
} catch (recreateError) {
|
|
18959
|
-
throw new Error(`Failed to re-create ${logicalId} after the --replace delete-first fallback already deleted the old resource (${currentResource.physicalId}): ${recreateError instanceof Error ? recreateError.message : String(recreateError)}. Re-run the deploy to create it fresh.`);
|
|
18960
|
-
}
|
|
18975
|
+
createResult = await this.replaceDeleteFirstAndRecreate(logicalId, resourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps);
|
|
18976
|
+
}
|
|
18977
|
+
if (!deletedOldFirst && createResult.physicalId === currentResource.physicalId) {
|
|
18978
|
+
if (updateReplacePolicy === "Retain") throw new CdkdError(`${logicalId} (${resourceType}) requires replacement, but its Create API is name-idempotent: the create-first attempt returned the existing resource (${currentResource.physicalId}) instead of creating a new one, and UpdateReplacePolicy: Retain pins that resource in place. Rename the resource in your CDK code — with Retain, the old resource keeps the name, so a same-name replacement can never proceed.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
|
|
18979
|
+
if (this.options.replace !== true) throw new CdkdError(`${logicalId} (${resourceType}) requires replacement, but its Create API is name-idempotent: the create-first attempt returned the EXISTING resource (${currentResource.physicalId}) instead of creating a new one, so deleting the "old" resource would silently destroy the resource the deploy just reported as created. The resource has a user-supplied physical name; either change or remove the explicit name in your CDK code (a fresh or generated name lets the safe create-first order proceed), or re-run with \`cdkd deploy --replace\` to delete the old resource FIRST and recreate it under the same name (the resource is briefly unavailable while it is recreated). Note: this branch is also reached when the old resource was deleted out-of-band and the physical id is name-derived — there the create was a genuine fresh create; \`--replace\` converges that case too.`, "NAMED_REPLACEMENT_IDEMPOTENT_CREATE");
|
|
18980
|
+
this.logger.info(` Create-first returned the existing resource (name-idempotent Create API) and --replace is set — deleting old ${logicalId} (${currentResource.physicalId}) first...`);
|
|
18981
|
+
deletedOldFirst = true;
|
|
18982
|
+
createResult = await this.replaceDeleteFirstAndRecreate(logicalId, resourceType, currentResource, oldDeleteProvider, replaceProvider, replaceProps);
|
|
18961
18983
|
}
|
|
18962
18984
|
if (deletedOldFirst) {} else if (updateReplacePolicy === "Retain") this.logger.info(` Retaining old ${logicalId} (${currentResource.physicalId}) - UpdateReplacePolicy: Retain`);
|
|
18963
18985
|
else {
|
|
@@ -19298,5 +19320,5 @@ var DeployEngine = class {
|
|
|
19298
19320
|
};
|
|
19299
19321
|
|
|
19300
19322
|
//#endregion
|
|
19301
|
-
export {
|
|
19302
|
-
//# sourceMappingURL=deploy-engine-
|
|
19323
|
+
export { WorkGraph as $, NestedStackChildDirectDestroyError as $t, slowCcOperationTimeoutMs as A, CFN_TEMPLATE_BODY_LIMIT as At, applyRoleArnIfSet as B, AwsClients as Bt, yellow as C, resolveAutoAssetStorage as Ct, ProviderRegistry as D, resolveStateBucketWithDefaultAndSource as Dt, clearOnUpdateRemoval as E, resolveStateBucketWithDefault as Et, refStateLookupFromResource as F, expectedOwnerParam as Ft, DagBuilder as G, CdkdError as Gt, describeTypeWithThrottleRetry as H, resetAwsClients as Ht, WAFv2WebACLProvider as I, AssemblyReader as It, S3StateBackend as J, LocalInvokeBuildError as Jt, TemplateParser as K, ConfigError as Kt, normalizeAwsTagsToCfn as L, processStackMessages as Lt, isTerminationProtectionPropagationError as M, MIGRATE_TMP_PREFIX as Mt, IntrinsicFunctionResolver as N, findLargeInlineResources as Nt, findActionableSilentDrops as O, resolveUseCdkBootstrapAssets as Ot, cfnRefValueFromPhysicalId as P, uploadCfnTemplate as Pt, stringifyValue as Q, MissingCdkCliError as Qt, resolveExplicitPhysicalId as R, clearBucketRegionCache as Rt, red as S, resolveApp as St, collectInlinePolicyNamesManagedBySiblings as T, resolveSkipPrefix as Tt, withRetry as U, setAwsClients as Ut, DiffCalculator as V, getAwsClients as Vt, isRetryableTransientError as W, AssetError as Wt, shouldRetainResource as X, LocalStartServiceError as Xt, rebuildClientForBucketRegion as Y, LocalMigrateError as Yt, AssetPublisher as Z, LockError as Zt, formatResourceLine as _, getDockerImageBySourceHash as _t, DeploymentEventsStore as a, StackTerminationProtectionError as an, BOOTSTRAP_MARKER_PREFIX as at, gray as b, getDefaultStateBucketName as bt, replayFailedOperations as c, formatError as cn, parseBootstrapMarker as ct, IMPLICIT_DELETE_DEPENDENCIES as d, withErrorHandling as dn, buildDockerImage as dt, PartialFailureError as en, buildAssetRedirectMap as et, computeImplicitDeleteEdges as f, __exportAll as fn, formatDockerLoginError as ft, renderStatefulReason as g, AssetManifestLoader as gt, isStatefulRecreateTargetSync as h, runDockerStreaming as ht, DeploymentEventsReader as i, StackHasActiveImportsError as in, AssetModeResolver as it, disableInstanceApiTermination as j, CFN_TEMPLATE_URL_LIMIT as jt, CloudControlProvider as k, warnDeprecatedNoPrefixCliFlag as kt, replayRollback as l, isCdkdError as ln, validateAssetBucketName as lt, MULTI_REGION_RECREATE_BLOCKED_TYPES as m, runDockerForeground as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, ResourceTimeoutError as nn, loadPublishableAssetManifest as nt, planFailedOps as o, StateError as on, ensureAssetStorage as ot, extractDeploymentEventError as p, getDockerCmd as pt, LockManager as q, DependencyError as qt, DeployEngine as r, ResourceUpdateNotSupportedError as rn, rewriteTemplateAssetReferences as rt, planRollback as s, SynthesisError as sn, getBootstrapMarkerKey as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, ProvisioningError as tn, createAssetRedirectResolver as tt, withResourceDeadline as u, normalizeAwsError as un, validateContainerRepoName as ut, bold as v, Synthesizer as vt, IAMRoleProvider as w, resolveCaptureObservedState as wt, green as x, getLegacyStateBucketName as xt, cyan as y, synthesisStatusMessage as yt, assertRegionMatch as z, resolveBucketRegion as zt };
|
|
19324
|
+
//# sourceMappingURL=deploy-engine-COX8YJsC.js.map
|