@go-to-k/cdkd 0.257.1 → 0.257.2

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.
@@ -11077,6 +11077,65 @@ function unsupportedTypeIssueUrl(resourceType) {
11077
11077
  return `https://github.com/go-to-k/cdkd/issues/new?title=${encodeURIComponent(`Support resource type ${resourceType}`)}&labels=resource-support`;
11078
11078
  }
11079
11079
 
11080
+ //#endregion
11081
+ //#region src/provisioning/slow-cc-operation-timeouts.ts
11082
+ const MINUTE_MS = 60 * 1e3;
11083
+ /**
11084
+ * 60 min covers the worst-case observed for each type with headroom over the
11085
+ * 15-30 min typical range. Keyed by CloudFormation type name. RDS / ElastiCache
11086
+ * carry SDK providers today (only CC-routed via #614), but the outer-deadline
11087
+ * sites are provider-agnostic, so listing them here also lifts their SDK-path
11088
+ * deletes, which are the same slow class.
11089
+ */
11090
+ const SLOW_CC_OPERATION_TIMEOUTS = {
11091
+ "AWS::OpenSearchService::Domain": {
11092
+ create: 60 * MINUTE_MS,
11093
+ update: 60 * MINUTE_MS,
11094
+ delete: 60 * MINUTE_MS
11095
+ },
11096
+ "AWS::Elasticsearch::Domain": {
11097
+ create: 60 * MINUTE_MS,
11098
+ update: 60 * MINUTE_MS,
11099
+ delete: 60 * MINUTE_MS
11100
+ },
11101
+ "AWS::Redshift::Cluster": {
11102
+ create: 60 * MINUTE_MS,
11103
+ delete: 60 * MINUTE_MS
11104
+ },
11105
+ "AWS::ElastiCache::ReplicationGroup": {
11106
+ create: 60 * MINUTE_MS,
11107
+ delete: 60 * MINUTE_MS
11108
+ },
11109
+ "AWS::ElastiCache::CacheCluster": {
11110
+ create: 60 * MINUTE_MS,
11111
+ delete: 60 * MINUTE_MS
11112
+ },
11113
+ "AWS::RDS::DBInstance": {
11114
+ create: 60 * MINUTE_MS,
11115
+ delete: 60 * MINUTE_MS
11116
+ },
11117
+ "AWS::RDS::DBCluster": {
11118
+ create: 60 * MINUTE_MS,
11119
+ delete: 60 * MINUTE_MS
11120
+ }
11121
+ };
11122
+ /**
11123
+ * The wall-clock floor (ms) a given resource type + operation needs, or `0`
11124
+ * when the type has no special requirement (the generic default applies).
11125
+ *
11126
+ * `0` is a safe additive identity for the outer `Math.max(...)` resolution
11127
+ * and a safe `Math.max` term for the inner CC cap (never shrinks a budget).
11128
+ */
11129
+ function slowCcOperationTimeoutMs(resourceType, operation) {
11130
+ const entry = SLOW_CC_OPERATION_TIMEOUTS[resourceType];
11131
+ if (!entry) return 0;
11132
+ switch (operation) {
11133
+ case "CREATE": return entry.create ?? 0;
11134
+ case "UPDATE": return entry.update ?? 0;
11135
+ case "DELETE": return entry.delete ?? 0;
11136
+ }
11137
+ }
11138
+
11080
11139
  //#endregion
11081
11140
  //#region src/provisioning/cloud-control-provider.ts
11082
11141
  /**
@@ -11170,7 +11229,7 @@ var CloudControlProvider = class {
11170
11229
  }));
11171
11230
  if (!createResponse.ProgressEvent?.RequestToken) throw new ProvisioningError(`Failed to create resource ${logicalId}: No request token received`, resourceType, logicalId);
11172
11231
  this.logger.debug(`Create request submitted for ${logicalId}, token: ${createResponse.ProgressEvent.RequestToken}`);
11173
- const progressEvent = await this.waitForOperation(createResponse.ProgressEvent.RequestToken, logicalId, "CREATE");
11232
+ const progressEvent = await this.waitForOperation(createResponse.ProgressEvent.RequestToken, logicalId, "CREATE", resourceType);
11174
11233
  if (!progressEvent.Identifier) throw new ProvisioningError(`Failed to create resource ${logicalId}: No physical ID returned`, resourceType, logicalId);
11175
11234
  this.logger.debug(`Created resource ${logicalId}, physical ID: ${progressEvent.Identifier}`);
11176
11235
  const result = { physicalId: progressEvent.Identifier };
@@ -11263,7 +11322,7 @@ var CloudControlProvider = class {
11263
11322
  }));
11264
11323
  if (!updateResponse.ProgressEvent?.RequestToken) throw new ProvisioningError(`Failed to update resource ${logicalId}: No request token received`, resourceType, logicalId, physicalId);
11265
11324
  this.logger.debug(`Update request submitted for ${logicalId}, token: ${updateResponse.ProgressEvent.RequestToken}`);
11266
- const progressEvent = await this.waitForOperation(updateResponse.ProgressEvent.RequestToken, logicalId, "UPDATE");
11325
+ const progressEvent = await this.waitForOperation(updateResponse.ProgressEvent.RequestToken, logicalId, "UPDATE", resourceType);
11267
11326
  this.logger.debug(`Updated resource ${logicalId}`);
11268
11327
  const result = {
11269
11328
  physicalId,
@@ -11284,7 +11343,7 @@ var CloudControlProvider = class {
11284
11343
  this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
11285
11344
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
11286
11345
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
11287
- const { ASGProvider } = await import("./asg-provider-6IZKZOKp.js").then((n) => n.n);
11346
+ const { ASGProvider } = await import("./asg-provider-4KjJhMTY.js").then((n) => n.n);
11288
11347
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
11289
11348
  return;
11290
11349
  }
@@ -11298,7 +11357,7 @@ var CloudControlProvider = class {
11298
11357
  }));
11299
11358
  if (!deleteResponse.ProgressEvent?.RequestToken) throw new ProvisioningError(`Failed to delete resource ${logicalId}: No request token received`, resourceType, logicalId, physicalId);
11300
11359
  this.logger.debug(`Delete request submitted for ${logicalId}, token: ${deleteResponse.ProgressEvent.RequestToken}`);
11301
- await this.waitForOperation(deleteResponse.ProgressEvent.RequestToken, logicalId, "DELETE");
11360
+ await this.waitForOperation(deleteResponse.ProgressEvent.RequestToken, logicalId, "DELETE", resourceType);
11302
11361
  this.logger.debug(`Deleted resource ${logicalId}`);
11303
11362
  return;
11304
11363
  } catch (error) {
@@ -11336,11 +11395,12 @@ var CloudControlProvider = class {
11336
11395
  /**
11337
11396
  * Wait for an asynchronous operation to complete
11338
11397
  */
11339
- async waitForOperation(requestToken, logicalId, operation) {
11398
+ async waitForOperation(requestToken, logicalId, operation, resourceType) {
11340
11399
  const startTime = Date.now();
11341
11400
  let attempts = 0;
11342
11401
  let pollInterval = this.INITIAL_POLL_INTERVAL_MS;
11343
- while (Date.now() - startTime < this.MAX_WAIT_TIME_MS) {
11402
+ const maxWaitMs = Math.max(this.MAX_WAIT_TIME_MS, slowCcOperationTimeoutMs(resourceType, operation));
11403
+ while (Date.now() - startTime < maxWaitMs) {
11344
11404
  attempts++;
11345
11405
  const progressEvent = (await this.cloudControlClient.send(new GetResourceRequestStatusCommand({ RequestToken: requestToken }))).ProgressEvent;
11346
11406
  if (!progressEvent) throw new ProvisioningError(`Failed to get status for ${logicalId}: No progress event`, "Unknown", logicalId);
@@ -11360,7 +11420,7 @@ var CloudControlProvider = class {
11360
11420
  pollInterval = Math.min(Math.ceil(pollInterval * 1.5), this.MAX_POLL_INTERVAL_MS);
11361
11421
  }
11362
11422
  }
11363
- throw new ProvisioningError(`${operation} timeout for ${logicalId} after ${this.MAX_WAIT_TIME_MS / 1e3}s`, "Unknown", logicalId);
11423
+ throw new ProvisioningError(`${operation} timeout for ${logicalId} after ${maxWaitMs / 1e3}s`, "Unknown", logicalId);
11364
11424
  }
11365
11425
  /**
11366
11426
  * Parse resource model JSON string
@@ -17213,7 +17273,8 @@ var DeployEngine = class {
17213
17273
  const providerMinTimeoutMs = this.providerRegistry.getProvider(resourceType).getMinResourceTimeoutMs?.() ?? 0;
17214
17274
  const warnAfterMs = this.options.resourceWarnAfterByType?.[resourceType] ?? this.options.resourceWarnAfterMs ?? 3e5;
17215
17275
  const globalTimeoutMs = this.options.resourceTimeoutMs ?? 18e5;
17216
- const timeoutMs = this.options.resourceTimeoutByType?.[resourceType] ?? Math.max(providerMinTimeoutMs, globalTimeoutMs);
17276
+ const slowTypeMinTimeoutMs = slowCcOperationTimeoutMs(resourceType, operationKind);
17277
+ const timeoutMs = this.options.resourceTimeoutByType?.[resourceType] ?? Math.max(providerMinTimeoutMs, slowTypeMinTimeoutMs, globalTimeoutMs);
17217
17278
  const eventOp = operationKind;
17218
17279
  const resourceStartedAt = Date.now();
17219
17280
  this.recordEvent({
@@ -17799,5 +17860,5 @@ var DeployEngine = class {
17799
17860
  };
17800
17861
 
17801
17862
  //#endregion
17802
- export { BOOTSTRAP_MARKER_PREFIX as $, StateError as $t, withRetry as A, AssemblyReader as At, TemplateParser as B, DependencyError as Bt, disableInstanceApiTermination as C, warnDeprecatedNoPrefixCliFlag as Ct, refStateLookupFromResource as D, findLargeInlineResources as Dt, cfnRefValueFromPhysicalId as E, MIGRATE_TMP_PREFIX as Et, resolveExplicitPhysicalId as F, resetAwsClients as Ft, AssetPublisher as G, MissingCdkCliError as Gt, S3StateBackend as H, LocalMigrateError as Ht, assertRegionMatch as I, setAwsClients as It, buildAssetRedirectMap as J, ProvisioningError as Jt, stringifyValue as K, NestedStackChildDirectDestroyError as Kt, applyRoleArnIfSet as L, AssetError as Lt, CDK_PATH_TAG as M, resolveBucketRegion as Mt, matchesCdkPath as N, AwsClients as Nt, WAFv2WebACLProvider as O, uploadCfnTemplate as Ot, normalizeAwsTagsToCfn as P, getAwsClients as Pt, AssetModeResolver as Q, StackTerminationProtectionError as Qt, DiffCalculator as R, CdkdError as Rt, CloudControlProvider as S, resolveUseCdkBootstrapAssets as St, IntrinsicFunctionResolver as T, CFN_TEMPLATE_URL_LIMIT as Tt, rebuildClientForBucketRegion as U, LocalStartServiceError as Ut, LockManager as V, LocalInvokeBuildError as Vt, shouldRetainResource as W, LockError as Wt, loadPublishableAssetManifest as X, ResourceUpdateNotSupportedError as Xt, createAssetRedirectResolver as Y, ResourceTimeoutError as Yt, rewriteTemplateAssetReferences as Z, StackHasActiveImportsError as Zt, yellow as _, resolveAutoAssetStorage as _t, IMPLICIT_DELETE_DEPENDENCIES as a, __exportAll as an, buildDockerImage as at, ProviderRegistry as b, resolveStateBucketWithDefault as bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as c, runDockerForeground as ct, formatResourceLine as d, getDockerImageBySourceHash as dt, SynthesisError as en, ensureAssetStorage as et, bold as f, Synthesizer as ft, red as g, resolveApp as gt, green as h, getLegacyStateBucketName as ht, withResourceDeadline as i, withErrorHandling as in, validateContainerRepoName as it, isRetryableTransientError as j, clearBucketRegionCache as jt, importTagWalk as k, expectedOwnerParam as kt, isStatefulRecreateTargetSync as l, runDockerStreaming as lt, gray as m, getDefaultStateBucketName as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, isCdkdError as nn, parseBootstrapMarker as nt, computeImplicitDeleteEdges as o, formatDockerLoginError as ot, cyan as p, synthesisStatusMessage as pt, WorkGraph as q, PartialFailureError as qt, DeployEngine as r, normalizeAwsError as rn, validateAssetBucketName as rt, extractDeploymentEventError as s, getDockerCmd as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, formatError as tn, getBootstrapMarkerKey as tt, renderStatefulReason as u, AssetManifestLoader as ut, IAMRoleProvider as v, resolveCaptureObservedState as vt, isTerminationProtectionPropagationError as w, CFN_TEMPLATE_BODY_LIMIT as wt, findActionableSilentDrops as x, resolveStateBucketWithDefaultAndSource as xt, collectInlinePolicyNamesManagedBySiblings as y, resolveSkipPrefix as yt, DagBuilder as z, ConfigError as zt };
17803
- //# sourceMappingURL=deploy-engine-DOPBIRKR.js.map
17863
+ export { AssetModeResolver as $, StackTerminationProtectionError as $t, importTagWalk as A, expectedOwnerParam as At, DagBuilder as B, ConfigError as Bt, slowCcOperationTimeoutMs as C, resolveUseCdkBootstrapAssets as Ct, cfnRefValueFromPhysicalId as D, MIGRATE_TMP_PREFIX as Dt, IntrinsicFunctionResolver as E, CFN_TEMPLATE_URL_LIMIT as Et, normalizeAwsTagsToCfn as F, getAwsClients as Ft, shouldRetainResource as G, LockError as Gt, LockManager as H, LocalInvokeBuildError as Ht, resolveExplicitPhysicalId as I, resetAwsClients as It, WorkGraph as J, PartialFailureError as Jt, AssetPublisher as K, MissingCdkCliError as Kt, assertRegionMatch as L, setAwsClients as Lt, isRetryableTransientError as M, clearBucketRegionCache as Mt, CDK_PATH_TAG as N, resolveBucketRegion as Nt, refStateLookupFromResource as O, findLargeInlineResources as Ot, matchesCdkPath as P, AwsClients as Pt, rewriteTemplateAssetReferences as Q, StackHasActiveImportsError as Qt, applyRoleArnIfSet as R, AssetError as Rt, CloudControlProvider as S, resolveStateBucketWithDefaultAndSource as St, isTerminationProtectionPropagationError as T, CFN_TEMPLATE_BODY_LIMIT as Tt, S3StateBackend as U, LocalMigrateError as Ut, TemplateParser as V, DependencyError as Vt, rebuildClientForBucketRegion as W, LocalStartServiceError as Wt, createAssetRedirectResolver as X, ResourceTimeoutError as Xt, buildAssetRedirectMap as Y, ProvisioningError as Yt, loadPublishableAssetManifest as Z, ResourceUpdateNotSupportedError as Zt, yellow as _, resolveApp as _t, IMPLICIT_DELETE_DEPENDENCIES as a, withErrorHandling as an, validateContainerRepoName as at, ProviderRegistry as b, resolveSkipPrefix as bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as c, getDockerCmd as ct, formatResourceLine as d, AssetManifestLoader as dt, StateError as en, BOOTSTRAP_MARKER_PREFIX as et, bold as f, getDockerImageBySourceHash as ft, red as g, getLegacyStateBucketName as gt, green as h, getDefaultStateBucketName as ht, withResourceDeadline as i, normalizeAwsError as in, validateAssetBucketName as it, withRetry as j, AssemblyReader as jt, WAFv2WebACLProvider as k, uploadCfnTemplate as kt, isStatefulRecreateTargetSync as l, runDockerForeground as lt, gray as m, synthesisStatusMessage as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, formatError as nn, getBootstrapMarkerKey as nt, computeImplicitDeleteEdges as o, __exportAll as on, buildDockerImage as ot, cyan as p, Synthesizer as pt, stringifyValue as q, NestedStackChildDirectDestroyError as qt, DeployEngine as r, isCdkdError as rn, parseBootstrapMarker as rt, extractDeploymentEventError as s, formatDockerLoginError as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, SynthesisError as tn, ensureAssetStorage as tt, renderStatefulReason as u, runDockerStreaming as ut, IAMRoleProvider as v, resolveAutoAssetStorage as vt, disableInstanceApiTermination as w, warnDeprecatedNoPrefixCliFlag as wt, findActionableSilentDrops as x, resolveStateBucketWithDefault as xt, collectInlinePolicyNamesManagedBySiblings as y, resolveCaptureObservedState as yt, DiffCalculator as z, CdkdError as zt };
17864
+ //# sourceMappingURL=deploy-engine-wmvXbyoB.js.map