@go-to-k/cdkd 0.272.0 → 0.273.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.
@@ -11427,28 +11427,27 @@ function unescapeJsonPointerSegment(segment) {
11427
11427
 
11428
11428
  //#endregion
11429
11429
  //#region src/provisioning/cc-protection-properties.ts
11430
+ const CC_PROTECTION_PROPERTIES = {
11431
+ "AWS::DSQL::Cluster": {
11432
+ property: "DeletionProtectionEnabled",
11433
+ offValue: false
11434
+ },
11435
+ "AWS::NeptuneGraph::Graph": {
11436
+ property: "DeletionProtection",
11437
+ offValue: false
11438
+ },
11439
+ "AWS::SMSVOICE::ProtectConfiguration": {
11440
+ property: "DeletionProtectionEnabled",
11441
+ offValue: false
11442
+ },
11443
+ "AWS::VerifiedPermissions::PolicyStore": {
11444
+ property: "DeletionProtection",
11445
+ offValue: { Mode: "DISABLED" }
11446
+ }
11447
+ };
11430
11448
  /**
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.
11449
+ * Returns the protection entry for a CC-routed resource type, or undefined
11450
+ * when the type has no registered protection property.
11452
11451
  */
11453
11452
  function ccProtectionProperty(resourceType) {
11454
11453
  return CC_PROTECTION_PROPERTIES[resourceType];
@@ -11987,15 +11986,15 @@ var CloudControlProvider = class {
11987
11986
  this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
11988
11987
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
11989
11988
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
11990
- const { ASGProvider } = await import("./asg-provider-qtJX36If.js").then((n) => n.n);
11989
+ const { ASGProvider } = await import("./asg-provider-kIy8tYTG.js").then((n) => n.n);
11991
11990
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
11992
11991
  return;
11993
11992
  }
11994
11993
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
11995
11994
  if (isProtectedEc2Instance) await disableInstanceApiTermination(getAwsClients().ec2, physicalId, this.logger);
11996
11995
  if (context?.removeProtection === true) {
11997
- const protectionProperty = ccProtectionProperty(resourceType);
11998
- if (protectionProperty) await this.disableCcProtection(logicalId, physicalId, resourceType, protectionProperty);
11996
+ const protectionEntry = ccProtectionProperty(resourceType);
11997
+ if (protectionEntry) await this.disableCcProtection(logicalId, physicalId, resourceType, protectionEntry);
11999
11998
  }
12000
11999
  const maxAttempts = isProtectedEc2Instance ? 5 : 1;
12001
12000
  for (let attempt = 1;; attempt++) try {
@@ -12025,20 +12024,22 @@ var CloudControlProvider = class {
12025
12024
  }
12026
12025
  }
12027
12026
  /**
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.
12027
+ * Set a registry-declared deletion-protection property to its "off" value
12028
+ * in-place via a CC UpdateResource patch (issues #1312 / #1314).
12029
+ * Best-effort: failures are logged at warn and swallowed — the subsequent
12030
+ * DeleteResource surfaces the real error if the protection is still on.
12031
+ * The `add` patch op is used (RFC 6902: replaces when the path exists,
12032
+ * adds when absent), so the flip is idempotent regardless of whether the
12033
+ * live model carries the property.
12034
12034
  */
12035
- async disableCcProtection(logicalId, physicalId, resourceType, protectionProperty) {
12035
+ async disableCcProtection(logicalId, physicalId, resourceType, entry) {
12036
+ const protectionProperty = entry.property;
12036
12037
  this.logger.debug(`Disabling ${protectionProperty} on ${logicalId} (${resourceType}) before delete (--remove-protection)`);
12037
12038
  try {
12038
12039
  const patch = [{
12039
12040
  op: "add",
12040
12041
  path: `/${protectionProperty}`,
12041
- value: false
12042
+ value: entry.offValue
12042
12043
  }];
12043
12044
  const response = await this.cloudControlClient.send(new UpdateResourceCommand({
12044
12045
  TypeName: resourceType,
@@ -17754,7 +17755,7 @@ const FLUSH_INTERVAL_MS = 2e3;
17754
17755
  const FLUSH_EVENT_THRESHOLD = 50;
17755
17756
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
17756
17757
  function getCdkdVersion() {
17757
- return "0.272.0";
17758
+ return "0.273.0";
17758
17759
  }
17759
17760
  /**
17760
17761
  * Generate a time-sortable unique run id, e.g.
@@ -19800,4 +19801,4 @@ var DeployEngine = class {
19800
19801
 
19801
19802
  //#endregion
19802
19803
  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 };
19803
- //# sourceMappingURL=deploy-engine-DbrhfQ9b.js.map
19804
+ //# sourceMappingURL=deploy-engine-DrZSOAoG.js.map