@go-to-k/cdkd 0.271.0 → 0.272.0
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/README.md +1 -0
- package/dist/{asg-provider-CpHXw10b.js → asg-provider-qtJX36If.js} +2 -2
- package/dist/{asg-provider-CpHXw10b.js.map → asg-provider-qtJX36If.js.map} +1 -1
- package/dist/cli.js +6 -5
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-DlTH1ou6.js → deploy-engine-DbrhfQ9b.js} +68 -3
- package/dist/{deploy-engine-DlTH1ou6.js.map → deploy-engine-DbrhfQ9b.js.map} +1 -1
- 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
|
@@ -11425,6 +11425,35 @@ function unescapeJsonPointerSegment(segment) {
|
|
|
11425
11425
|
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
11426
11426
|
}
|
|
11427
11427
|
|
|
11428
|
+
//#endregion
|
|
11429
|
+
//#region src/provisioning/cc-protection-properties.ts
|
|
11430
|
+
/**
|
|
11431
|
+
* Deletion-protection properties for Cloud-Control-routed resource types.
|
|
11432
|
+
*
|
|
11433
|
+
* Cloud Control's DeleteResource has no notion of deletion protection: a
|
|
11434
|
+
* protected resource simply fails to delete. For types WITH an SDK provider,
|
|
11435
|
+
* `--remove-protection` is implemented inside each provider's `delete()`
|
|
11436
|
+
* (RDS / DynamoDB / Cognito / etc.), and two special cases are hardcoded in
|
|
11437
|
+
* `CloudControlProvider.delete` (ASG delegation, EC2 `DisableApiTermination`).
|
|
11438
|
+
* This registry covers the remaining case: a CC-routed type whose protection
|
|
11439
|
+
* is an ordinary top-level boolean template property that can be flipped off
|
|
11440
|
+
* in-place via a CC UpdateResource patch right before DeleteResource.
|
|
11441
|
+
*
|
|
11442
|
+
* Only add entries verified against real AWS (the property name must match
|
|
11443
|
+
* the type's CFn schema exactly, and the type's UPDATE handler must support
|
|
11444
|
+
* flipping it in-place). Candidates such as `AWS::QLDB::Ledger`
|
|
11445
|
+
* (`DeletionProtection`) or `AWS::RDS::GlobalCluster` (`DeletionProtection`)
|
|
11446
|
+
* can join once live-verified — see issue #1312.
|
|
11447
|
+
*/
|
|
11448
|
+
const CC_PROTECTION_PROPERTIES = { "AWS::DSQL::Cluster": "DeletionProtectionEnabled" };
|
|
11449
|
+
/**
|
|
11450
|
+
* Returns the top-level protection property name for a CC-routed resource
|
|
11451
|
+
* type, or undefined when the type has no registered protection property.
|
|
11452
|
+
*/
|
|
11453
|
+
function ccProtectionProperty(resourceType) {
|
|
11454
|
+
return CC_PROTECTION_PROPERTIES[resourceType];
|
|
11455
|
+
}
|
|
11456
|
+
|
|
11428
11457
|
//#endregion
|
|
11429
11458
|
//#region src/provisioning/unsupported-types.generated.ts
|
|
11430
11459
|
/**
|
|
@@ -11958,12 +11987,16 @@ var CloudControlProvider = class {
|
|
|
11958
11987
|
this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
|
|
11959
11988
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
11960
11989
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
11961
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
11990
|
+
const { ASGProvider } = await import("./asg-provider-qtJX36If.js").then((n) => n.n);
|
|
11962
11991
|
await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
11963
11992
|
return;
|
|
11964
11993
|
}
|
|
11965
11994
|
const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
|
|
11966
11995
|
if (isProtectedEc2Instance) await disableInstanceApiTermination(getAwsClients().ec2, physicalId, this.logger);
|
|
11996
|
+
if (context?.removeProtection === true) {
|
|
11997
|
+
const protectionProperty = ccProtectionProperty(resourceType);
|
|
11998
|
+
if (protectionProperty) await this.disableCcProtection(logicalId, physicalId, resourceType, protectionProperty);
|
|
11999
|
+
}
|
|
11967
12000
|
const maxAttempts = isProtectedEc2Instance ? 5 : 1;
|
|
11968
12001
|
for (let attempt = 1;; attempt++) try {
|
|
11969
12002
|
const deleteResponse = await this.cloudControlClient.send(new DeleteResourceCommand({
|
|
@@ -11992,6 +12025,38 @@ var CloudControlProvider = class {
|
|
|
11992
12025
|
}
|
|
11993
12026
|
}
|
|
11994
12027
|
/**
|
|
12028
|
+
* Flip a registry-declared deletion-protection property off in-place via a
|
|
12029
|
+
* CC UpdateResource patch (issue #1312). Best-effort: failures are logged
|
|
12030
|
+
* at warn and swallowed — the subsequent DeleteResource surfaces the real
|
|
12031
|
+
* error if the protection is still on. The `add` patch op is used (RFC
|
|
12032
|
+
* 6902: replaces when the path exists, adds when absent), so the flip is
|
|
12033
|
+
* idempotent regardless of whether the live model carries the property.
|
|
12034
|
+
*/
|
|
12035
|
+
async disableCcProtection(logicalId, physicalId, resourceType, protectionProperty) {
|
|
12036
|
+
this.logger.debug(`Disabling ${protectionProperty} on ${logicalId} (${resourceType}) before delete (--remove-protection)`);
|
|
12037
|
+
try {
|
|
12038
|
+
const patch = [{
|
|
12039
|
+
op: "add",
|
|
12040
|
+
path: `/${protectionProperty}`,
|
|
12041
|
+
value: false
|
|
12042
|
+
}];
|
|
12043
|
+
const response = await this.cloudControlClient.send(new UpdateResourceCommand({
|
|
12044
|
+
TypeName: resourceType,
|
|
12045
|
+
Identifier: physicalId,
|
|
12046
|
+
PatchDocument: JSON.stringify(patch)
|
|
12047
|
+
}));
|
|
12048
|
+
if (!response.ProgressEvent?.RequestToken) {
|
|
12049
|
+
this.logger.warn(`Could not disable ${protectionProperty} on ${logicalId}: no request token received; proceeding with delete`);
|
|
12050
|
+
return;
|
|
12051
|
+
}
|
|
12052
|
+
await this.waitForOperation(response.ProgressEvent.RequestToken, logicalId, "UPDATE", resourceType);
|
|
12053
|
+
this.logger.debug(`Disabled ${protectionProperty} on ${logicalId}`);
|
|
12054
|
+
} catch (error) {
|
|
12055
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
12056
|
+
this.logger.warn(`Could not disable ${protectionProperty} on ${logicalId} (${resourceType}): ${message}; proceeding with delete`);
|
|
12057
|
+
}
|
|
12058
|
+
}
|
|
12059
|
+
/**
|
|
11995
12060
|
* Get current state of a resource
|
|
11996
12061
|
*/
|
|
11997
12062
|
async getResourceState(resourceType, physicalId) {
|
|
@@ -17689,7 +17754,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
17689
17754
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
17690
17755
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
17691
17756
|
function getCdkdVersion() {
|
|
17692
|
-
return "0.
|
|
17757
|
+
return "0.272.0";
|
|
17693
17758
|
}
|
|
17694
17759
|
/**
|
|
17695
17760
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -19735,4 +19800,4 @@ var DeployEngine = class {
|
|
|
19735
19800
|
|
|
19736
19801
|
//#endregion
|
|
19737
19802
|
export { WorkGraph as $, LockError as $t, slowCcOperationTimeoutMs as A, warnDeprecatedNoPrefixCliFlag as At, applyRoleArnIfSet as B, resolveBucketRegion as Bt, yellow as C, resolveAutoAssetStorage as Ct, ProviderRegistry as D, resolveStateBucketWithDefaultAndSource as Dt, clearOnUpdateRemoval as E, resolveStateBucketWithDefault as Et, refStateLookupFromResource as F, uploadCfnTemplate as Ft, DagBuilder as G, AssetError as Gt, describeTypeWithThrottleRetry as H, getAwsClients as Ht, WAFv2WebACLProvider as I, expectedOwnerParam as It, S3StateBackend as J, DependencyError as Jt, TemplateParser as K, CdkdError as Kt, normalizeAwsTagsToCfn as L, AssemblyReader as Lt, isTerminationProtectionPropagationError as M, CFN_TEMPLATE_URL_LIMIT as Mt, IntrinsicFunctionResolver as N, MIGRATE_TMP_PREFIX as Nt, findActionableSilentDrops as O, resolveUseCdkBootstrapAssets as Ot, cfnRefValueFromPhysicalId as P, findLargeInlineResources as Pt, stringifyValue as Q, LocalStartServiceError as Qt, resolveExplicitPhysicalId as R, processStackMessages as Rt, red as S, resolveApp as St, collectInlinePolicyNamesManagedBySiblings as T, resolveSkipPrefix as Tt, withRetry as U, resetAwsClients as Ut, DiffCalculator as V, AwsClients as Vt, isRetryableTransientError as W, setAwsClients as Wt, shouldRetainResource as X, LocalInvokeBuildError as Xt, rebuildClientForBucketRegion as Y, DeployCancelledError as Yt, AssetPublisher as Z, LocalMigrateError as Zt, formatResourceLine as _, getDockerImageBySourceHash as _t, DeploymentEventsStore as a, ResourceUpdateNotSupportedError as an, BOOTSTRAP_MARKER_PREFIX as at, gray as b, getDefaultStateBucketName as bt, replayFailedOperations as c, StateError as cn, parseBootstrapMarker as ct, IMPLICIT_DELETE_DEPENDENCIES as d, isCdkdError as dn, buildDockerImage as dt, MissingCdkCliError as en, buildAssetRedirectMap as et, computeImplicitDeleteEdges as f, normalizeAwsError as fn, formatDockerLoginError as ft, renderStatefulReason as g, AssetManifestLoader as gt, isStatefulRecreateTargetSync as h, runDockerStreaming as ht, DeploymentEventsReader as i, ResourceTimeoutError as in, AssetModeResolver as it, disableInstanceApiTermination as j, CFN_TEMPLATE_BODY_LIMIT as jt, CloudControlProvider as k, stateBucketExistenceConfirmed as kt, replayRollback as l, SynthesisError as ln, validateAssetBucketName as lt, MULTI_REGION_RECREATE_BLOCKED_TYPES as m, __exportAll as mn, runDockerForeground as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, PartialFailureError as nn, loadPublishableAssetManifest as nt, planFailedOps as o, StackHasActiveImportsError as on, ensureAssetStorage as ot, extractDeploymentEventError as p, withErrorHandling as pn, getDockerCmd as pt, LockManager as q, ConfigError as qt, DeployEngine as r, ProvisioningError as rn, rewriteTemplateAssetReferences as rt, planRollback as s, StackTerminationProtectionError as sn, getBootstrapMarkerKey as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, NestedStackChildDirectDestroyError as tn, createAssetRedirectResolver as tt, withResourceDeadline as u, formatError 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, clearBucketRegionCache as zt };
|
|
19738
|
-
//# sourceMappingURL=deploy-engine-
|
|
19803
|
+
//# sourceMappingURL=deploy-engine-DbrhfQ9b.js.map
|