@go-to-k/cdkd 0.268.0 → 0.268.1
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-ZylgRJOY.js → asg-provider-_vnp1pfL.js} +2 -2
- package/dist/{asg-provider-ZylgRJOY.js.map → asg-provider-_vnp1pfL.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{deploy-engine-B5cRuFij.js → deploy-engine-A2CeJkZr.js} +134 -22
- package/dist/deploy-engine-A2CeJkZr.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-B5cRuFij.js.map +0 -1
|
@@ -7648,12 +7648,26 @@ var ReplacementRulesRegistry = class {
|
|
|
7648
7648
|
//#endregion
|
|
7649
7649
|
//#region src/deployment/retryable-errors.ts
|
|
7650
7650
|
/**
|
|
7651
|
-
*
|
|
7652
|
-
*
|
|
7653
|
-
*
|
|
7654
|
-
*
|
|
7655
|
-
|
|
7656
|
-
|
|
7651
|
+
* The **IAM-propagation** subset of {@link RETRYABLE_ERROR_MESSAGE_PATTERNS}:
|
|
7652
|
+
* an AWS service rejecting a call because a just-created IAM entity (role,
|
|
7653
|
+
* trust policy, inline policy, instance profile, principal) has not propagated
|
|
7654
|
+
* to that service's authorization layer yet.
|
|
7655
|
+
*
|
|
7656
|
+
* Kept as its own array — and composed back into the full transient table
|
|
7657
|
+
* below — so there is exactly ONE list per pattern (no parallel classifier to
|
|
7658
|
+
* drift). It exists because this class has a materially different RECOVERY
|
|
7659
|
+
* SHAPE from the other transient errors: it resolves in single-digit seconds,
|
|
7660
|
+
* so `withRetry` polls it on a dense sub-second schedule instead of the
|
|
7661
|
+
* generic 1s/2s/4s/8s exponential backoff (which is right for throttling and
|
|
7662
|
+
* for long resource-state transitions, and wrong here — see
|
|
7663
|
+
* {@link file://../deployment/retry.ts}).
|
|
7664
|
+
*
|
|
7665
|
+
* When adding a new pattern: put it here if the fix is "wait a moment and ask
|
|
7666
|
+
* IAM again", and in `OTHER_TRANSIENT_ERROR_MESSAGE_PATTERNS` otherwise. A
|
|
7667
|
+
* misfiled entry only changes the retry CADENCE, never whether the error is
|
|
7668
|
+
* retryable at all.
|
|
7669
|
+
*/
|
|
7670
|
+
const IAM_PROPAGATION_ERROR_MESSAGE_PATTERNS = [
|
|
7657
7671
|
"cannot be assumed",
|
|
7658
7672
|
"Firehose is unable to assume role",
|
|
7659
7673
|
"is unable to assume provided role",
|
|
@@ -7664,12 +7678,6 @@ const RETRYABLE_ERROR_MESSAGE_PATTERNS = [
|
|
|
7664
7678
|
"Role validation failed",
|
|
7665
7679
|
"does not have required permissions",
|
|
7666
7680
|
"Trusted Entity",
|
|
7667
|
-
"currently in the following state: Pending",
|
|
7668
|
-
"has dependencies and cannot be deleted",
|
|
7669
|
-
"can't be deleted since it has",
|
|
7670
|
-
"DependencyViolation",
|
|
7671
|
-
"does not exist",
|
|
7672
|
-
"Schema is currently being altered",
|
|
7673
7681
|
"Invalid principal in policy",
|
|
7674
7682
|
"Policy Error: PrincipalNotFound",
|
|
7675
7683
|
"Invalid value for the parameter Policy",
|
|
@@ -7677,15 +7685,30 @@ const RETRYABLE_ERROR_MESSAGE_PATTERNS = [
|
|
|
7677
7685
|
"Caught ServiceAccessDeniedException",
|
|
7678
7686
|
"permissions required to assume the role",
|
|
7679
7687
|
"authorized to assume the provided role",
|
|
7680
|
-
"conflicting conditional operation",
|
|
7681
|
-
"scheduled for deletion",
|
|
7682
7688
|
"Cannot access stream",
|
|
7683
7689
|
"Please ensure the role can perform",
|
|
7684
7690
|
"KMS key is invalid for CreateGrant",
|
|
7685
7691
|
"Policy contains a statement with one or more invalid principals",
|
|
7686
7692
|
"Invalid IAM Instance Profile",
|
|
7687
7693
|
"Invalid InstanceProfile",
|
|
7688
|
-
"Failed to authorize instance profile"
|
|
7694
|
+
"Failed to authorize instance profile"
|
|
7695
|
+
];
|
|
7696
|
+
/**
|
|
7697
|
+
* The NON-IAM-propagation half of {@link RETRYABLE_ERROR_MESSAGE_PATTERNS}:
|
|
7698
|
+
* transient failures whose recovery window is either long (SQS's 60s same-name
|
|
7699
|
+
* cooldown, a resource still leaving a Pending/Creating state) or genuinely
|
|
7700
|
+
* load-related (throttling), where hammering AWS with dense retries is harmful
|
|
7701
|
+
* and exponential backoff is the correct shape.
|
|
7702
|
+
*/
|
|
7703
|
+
const OTHER_TRANSIENT_ERROR_MESSAGE_PATTERNS = [
|
|
7704
|
+
"currently in the following state: Pending",
|
|
7705
|
+
"has dependencies and cannot be deleted",
|
|
7706
|
+
"can't be deleted since it has",
|
|
7707
|
+
"DependencyViolation",
|
|
7708
|
+
"does not exist",
|
|
7709
|
+
"Schema is currently being altered",
|
|
7710
|
+
"conflicting conditional operation",
|
|
7711
|
+
"scheduled for deletion",
|
|
7689
7712
|
"Could not deliver test message",
|
|
7690
7713
|
"wait 60 seconds",
|
|
7691
7714
|
"concurrent update operation",
|
|
@@ -7693,6 +7716,16 @@ const RETRYABLE_ERROR_MESSAGE_PATTERNS = [
|
|
|
7693
7716
|
"Rate exceeded"
|
|
7694
7717
|
];
|
|
7695
7718
|
/**
|
|
7719
|
+
* Patterns that mark an AWS error as a transient/retryable failure.
|
|
7720
|
+
* Each entry is a substring match against the error message; all of these
|
|
7721
|
+
* are situations where the same call typically succeeds after a short delay
|
|
7722
|
+
* because of eventual consistency or just-created-dependency propagation.
|
|
7723
|
+
*
|
|
7724
|
+
* Composed from the two halves above so retryability has ONE source of truth
|
|
7725
|
+
* while `withRetry` can still pick a per-class backoff cadence.
|
|
7726
|
+
*/
|
|
7727
|
+
const RETRYABLE_ERROR_MESSAGE_PATTERNS = [...IAM_PROPAGATION_ERROR_MESSAGE_PATTERNS, ...OTHER_TRANSIENT_ERROR_MESSAGE_PATTERNS];
|
|
7728
|
+
/**
|
|
7696
7729
|
* HTTP status codes that always indicate a transient failure worth retrying.
|
|
7697
7730
|
* 429 = Too Many Requests (throttle), 503 = Service Unavailable.
|
|
7698
7731
|
*/
|
|
@@ -7762,6 +7795,24 @@ function isRetryableTransientError(error, message) {
|
|
|
7762
7795
|
return RETRYABLE_ERROR_MESSAGE_PATTERNS.some((p) => message.includes(p));
|
|
7763
7796
|
}
|
|
7764
7797
|
/**
|
|
7798
|
+
* True when the message is a just-created-IAM-entity propagation rejection
|
|
7799
|
+
* ({@link IAM_PROPAGATION_ERROR_MESSAGE_PATTERNS}).
|
|
7800
|
+
*
|
|
7801
|
+
* This does NOT decide retryability — every pattern it matches is already in
|
|
7802
|
+
* {@link RETRYABLE_ERROR_MESSAGE_PATTERNS}. It only selects the retry CADENCE:
|
|
7803
|
+
* `withRetry` polls this class densely (sub-second initial delay, low cap)
|
|
7804
|
+
* because IAM propagation resolves in single-digit seconds, whereas the
|
|
7805
|
+
* generic exponential schedule is tuned for throttling and long resource-state
|
|
7806
|
+
* transitions.
|
|
7807
|
+
*
|
|
7808
|
+
* Deliberately message-only (no error-object inspection): the propagation
|
|
7809
|
+
* signal is always carried in the vendor's message text, and cdkd wraps the
|
|
7810
|
+
* original error in a `ProvisioningError` that preserves it.
|
|
7811
|
+
*/
|
|
7812
|
+
function isIamPropagationError(message) {
|
|
7813
|
+
return IAM_PROPAGATION_ERROR_MESSAGE_PATTERNS.some((p) => message.includes(p));
|
|
7814
|
+
}
|
|
7815
|
+
/**
|
|
7765
7816
|
* Match the "already exists" name-collision signature raised when a create
|
|
7766
7817
|
* targets a physical name still held by another resource (or by the same
|
|
7767
7818
|
* name's not-yet-released tombstone after an async delete).
|
|
@@ -7820,6 +7871,48 @@ function isRecreateRetryableError(message) {
|
|
|
7820
7871
|
* in isolation. The retryable-error classifier itself lives in
|
|
7821
7872
|
* `./retryable-errors.ts`.
|
|
7822
7873
|
*/
|
|
7874
|
+
/**
|
|
7875
|
+
* Initial backoff for the IAM-propagation error class (issue: EC2 instance
|
|
7876
|
+
* launches burning ~10s of backoff waiting on a fresh instance profile).
|
|
7877
|
+
*
|
|
7878
|
+
* cdkd creates an `AWS::IAM::InstanceProfile` and issues `RunInstances` ~2.8s
|
|
7879
|
+
* later; CloudFormation and Terraform are slow enough between resources that
|
|
7880
|
+
* IAM has propagated by the time they call, cdkd outruns it. The measured
|
|
7881
|
+
* failure recovers in single-digit seconds, so the first re-probe should be
|
|
7882
|
+
* sub-second rather than the generic 1s.
|
|
7883
|
+
*/
|
|
7884
|
+
const IAM_PROPAGATION_INITIAL_DELAY_MS = 250;
|
|
7885
|
+
/**
|
|
7886
|
+
* Cap for the IAM-propagation backoff. Once the ramp reaches this value the
|
|
7887
|
+
* schedule stays FLAT — the whole point is a tight, predictable probe grid
|
|
7888
|
+
* across the window in which propagation completes, so the worst-case
|
|
7889
|
+
* overshoot is ~2s instead of the generic schedule's up-to-8s.
|
|
7890
|
+
*
|
|
7891
|
+
* Not lower than 2s on purpose: the retried call is usually a mutating,
|
|
7892
|
+
* tightly-rate-limited API (`RunInstances` refills ~2 req/s per account), and
|
|
7893
|
+
* the retry runs per-resource in parallel — three instances polling at 1s
|
|
7894
|
+
* would sit at 3 req/s and trade an IAM stall for a throttle stall. (If a
|
|
7895
|
+
* throttle DOES happen, its error classifies as non-propagation and the
|
|
7896
|
+
* generic exponential schedule takes over for that attempt, which is exactly
|
|
7897
|
+
* the desired self-correction.)
|
|
7898
|
+
*/
|
|
7899
|
+
const IAM_PROPAGATION_MAX_DELAY_MS = 2e3;
|
|
7900
|
+
/**
|
|
7901
|
+
* Retry budget for the IAM-propagation class.
|
|
7902
|
+
*
|
|
7903
|
+
* A denser schedule must NOT shrink the window in which propagation can still
|
|
7904
|
+
* be caught — that would trade latency for flakiness. The generic default
|
|
7905
|
+
* (1s/2s/4s/8s then capped, 8 retries) sleeps 47s in total, so the dense
|
|
7906
|
+
* schedule is given enough retries to cover at least as long:
|
|
7907
|
+
*
|
|
7908
|
+
* 0.25 + 0.5 + 1 + 2 x 23 = 47.75s over 26 retries
|
|
7909
|
+
*
|
|
7910
|
+
* Probe grid (seconds after the first failure): 0.25, 0.75, 1.75, 3.75, then
|
|
7911
|
+
* every 2s out to 47.75 — versus the generic 1, 3, 7, 15, 23, 31, 39, 47.
|
|
7912
|
+
* From 3.75s onwards the dense grid is strictly ahead, and it never lags the
|
|
7913
|
+
* generic one by more than 0.75s in the early band.
|
|
7914
|
+
*/
|
|
7915
|
+
const IAM_PROPAGATION_MAX_RETRIES = 26;
|
|
7823
7916
|
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7824
7917
|
/**
|
|
7825
7918
|
* Run `operation`, retrying transient failures with exponential backoff
|
|
@@ -7828,6 +7921,20 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
7828
7921
|
* Backoff at the defaults (initialDelayMs=1_000, maxDelayMs=8_000, maxRetries=8):
|
|
7829
7922
|
* 1s -> 2s -> 4s -> 8s -> 8s -> 8s -> 8s -> 8s (cumulative 47s)
|
|
7830
7923
|
*
|
|
7924
|
+
* IAM-propagation failures (see `isIamPropagationError`) instead use the dense
|
|
7925
|
+
* schedule 0.25s -> 0.5s -> 1s -> 2s -> 2s ... over
|
|
7926
|
+
* {@link IAM_PROPAGATION_MAX_RETRIES} retries (cumulative 47.75s), because that
|
|
7927
|
+
* class resolves in single-digit seconds and the generic schedule's coarse
|
|
7928
|
+
* 4s/8s steps overshoot it. The dense schedule applies ONLY when the caller
|
|
7929
|
+
* left the schedule at its defaults — a caller that passed its own
|
|
7930
|
+
* `maxRetries` / `initialDelayMs` / `maxDelayMs` / `isRetryable` picked that
|
|
7931
|
+
* schedule deliberately (e.g. the DELETE path's 3 x 5s, or the delete-then-
|
|
7932
|
+
* re-create sites' ~64s budget covering SQS's 60s name cooldown) and gets it
|
|
7933
|
+
* verbatim.
|
|
7934
|
+
*
|
|
7935
|
+
* The class is re-evaluated per attempt, so a propagation retry that runs into
|
|
7936
|
+
* a throttle backs OFF exponentially for that attempt instead of hammering.
|
|
7937
|
+
*
|
|
7831
7938
|
* Non-retryable errors are rethrown immediately. The transient-error
|
|
7832
7939
|
* classifier is `isRetryableTransientError` from ./retryable-errors.ts.
|
|
7833
7940
|
*/
|
|
@@ -7836,15 +7943,20 @@ async function withRetry(operation, logicalId, opts = {}) {
|
|
|
7836
7943
|
const initialDelayMs = opts.initialDelayMs ?? 1e3;
|
|
7837
7944
|
const maxDelayMs = opts.maxDelayMs ?? 8e3;
|
|
7838
7945
|
const sleep = opts.sleep ?? defaultSleep;
|
|
7946
|
+
const defaultSchedule = opts.maxRetries === void 0 && opts.initialDelayMs === void 0 && opts.maxDelayMs === void 0 && opts.isRetryable === void 0;
|
|
7947
|
+
const attemptCeiling = defaultSchedule ? Math.max(maxRetries, 26) : maxRetries;
|
|
7839
7948
|
let lastError;
|
|
7840
|
-
for (let attempt = 0; attempt <=
|
|
7949
|
+
for (let attempt = 0; attempt <= attemptCeiling; attempt++) try {
|
|
7841
7950
|
return await operation();
|
|
7842
7951
|
} catch (error) {
|
|
7843
7952
|
lastError = error;
|
|
7844
7953
|
const message = error instanceof Error ? error.message : String(error);
|
|
7845
|
-
|
|
7846
|
-
const
|
|
7847
|
-
|
|
7954
|
+
const retryable = opts.isRetryable ? opts.isRetryable(message, error) : isRetryableTransientError(error, message);
|
|
7955
|
+
const propagation = defaultSchedule && isIamPropagationError(message);
|
|
7956
|
+
const attemptLimit = propagation ? 26 : maxRetries;
|
|
7957
|
+
if (!retryable || attempt >= attemptLimit) throw error;
|
|
7958
|
+
const delay = propagation ? Math.min(250 * Math.pow(2, attempt), IAM_PROPAGATION_MAX_DELAY_MS) : Math.min(initialDelayMs * Math.pow(2, attempt), maxDelayMs);
|
|
7959
|
+
opts.logger?.debug(` ⏳ Retrying ${logicalId} in ${delay / 1e3}s (attempt ${attempt + 1}/${attemptLimit}) - ${message}`);
|
|
7848
7960
|
for (let waited = 0; waited < delay; waited += 1e3) {
|
|
7849
7961
|
if (opts.isInterrupted?.()) throw opts.onInterrupted ? opts.onInterrupted() : /* @__PURE__ */ new Error("Interrupted");
|
|
7850
7962
|
await sleep(Math.min(1e3, delay - waited));
|
|
@@ -11793,7 +11905,7 @@ var CloudControlProvider = class {
|
|
|
11793
11905
|
this.logger.debug(`Deleting resource ${logicalId} (${resourceType}), physical ID: ${physicalId}`);
|
|
11794
11906
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
11795
11907
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
11796
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
11908
|
+
const { ASGProvider } = await import("./asg-provider-_vnp1pfL.js").then((n) => n.n);
|
|
11797
11909
|
await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
11798
11910
|
return;
|
|
11799
11911
|
}
|
|
@@ -17505,7 +17617,7 @@ const FLUSH_INTERVAL_MS = 2e3;
|
|
|
17505
17617
|
const FLUSH_EVENT_THRESHOLD = 50;
|
|
17506
17618
|
/** Build-time cdkd version, with a dev fallback for non-built contexts. */
|
|
17507
17619
|
function getCdkdVersion() {
|
|
17508
|
-
return "0.268.
|
|
17620
|
+
return "0.268.1";
|
|
17509
17621
|
}
|
|
17510
17622
|
/**
|
|
17511
17623
|
* Generate a time-sortable unique run id, e.g.
|
|
@@ -19511,4 +19623,4 @@ var DeployEngine = class {
|
|
|
19511
19623
|
|
|
19512
19624
|
//#endregion
|
|
19513
19625
|
export { WorkGraph as $, MissingCdkCliError 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, LockError 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, LocalMigrateError as Xt, rebuildClientForBucketRegion as Y, LocalInvokeBuildError as Yt, AssetPublisher as Z, LocalStartServiceError as Zt, formatResourceLine as _, getDockerImageBySourceHash as _t, DeploymentEventsStore as a, StackHasActiveImportsError as an, BOOTSTRAP_MARKER_PREFIX as at, gray as b, getDefaultStateBucketName as bt, replayFailedOperations as c, SynthesisError as cn, parseBootstrapMarker as ct, IMPLICIT_DELETE_DEPENDENCIES as d, normalizeAwsError as dn, buildDockerImage as dt, NestedStackChildDirectDestroyError as en, buildAssetRedirectMap as et, computeImplicitDeleteEdges as f, withErrorHandling as fn, formatDockerLoginError as ft, renderStatefulReason as g, AssetManifestLoader as gt, isStatefulRecreateTargetSync as h, runDockerStreaming as ht, DeploymentEventsReader as i, ResourceUpdateNotSupportedError as in, AssetModeResolver as it, disableInstanceApiTermination as j, CFN_TEMPLATE_BODY_LIMIT as jt, CloudControlProvider as k, stateBucketExistenceConfirmed as kt, replayRollback as l, formatError as ln, validateAssetBucketName as lt, MULTI_REGION_RECREATE_BLOCKED_TYPES as m, runDockerForeground as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, ProvisioningError as nn, loadPublishableAssetManifest as nt, planFailedOps as o, StackTerminationProtectionError as on, ensureAssetStorage as ot, extractDeploymentEventError as p, __exportAll as pn, getDockerCmd as pt, LockManager as q, ConfigError as qt, DeployEngine as r, ResourceTimeoutError as rn, rewriteTemplateAssetReferences as rt, planRollback as s, StateError as sn, getBootstrapMarkerKey as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, PartialFailureError as tn, createAssetRedirectResolver as tt, withResourceDeadline as u, isCdkdError 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 };
|
|
19514
|
-
//# sourceMappingURL=deploy-engine-
|
|
19626
|
+
//# sourceMappingURL=deploy-engine-A2CeJkZr.js.map
|