@go-to-k/cdkd 0.221.10 → 0.221.12

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.
@@ -25,6 +25,7 @@ import { DescribeImagesCommand as DescribeImagesCommand$1, ECRClient, GetAuthori
25
25
  import { hostname } from "os";
26
26
  import graphlib from "graphlib";
27
27
  import { DescribeDBClustersCommand, DescribeDBInstancesCommand, RDSClient } from "@aws-sdk/client-rds";
28
+ import { DescribeReplicationGroupsCommand, ElastiCacheClient } from "@aws-sdk/client-elasticache";
28
29
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
29
30
 
30
31
  //#region src/utils/aws-region-resolver.ts
@@ -7550,6 +7551,28 @@ var CloudControlProvider = class {
7550
7551
  this.logger.debug(`Failed to get Lambda URL config for ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
7551
7552
  }
7552
7553
  break;
7554
+ case "AWS::ElastiCache::ReplicationGroup":
7555
+ try {
7556
+ const rg = (await new ElastiCacheClient({}).send(new DescribeReplicationGroupsCommand({ ReplicationGroupId: physicalId }))).ReplicationGroups?.[0];
7557
+ if (rg) {
7558
+ const primaryNode = rg.NodeGroups?.[0];
7559
+ if (primaryNode?.PrimaryEndpoint?.Address) enriched["PrimaryEndPoint.Address"] = primaryNode.PrimaryEndpoint.Address;
7560
+ if (primaryNode?.PrimaryEndpoint?.Port !== void 0) enriched["PrimaryEndPoint.Port"] = String(primaryNode.PrimaryEndpoint.Port);
7561
+ if (primaryNode?.ReaderEndpoint?.Address) enriched["ReaderEndPoint.Address"] = primaryNode.ReaderEndpoint.Address;
7562
+ if (primaryNode?.ReaderEndpoint?.Port !== void 0) enriched["ReaderEndPoint.Port"] = String(primaryNode.ReaderEndpoint.Port);
7563
+ if (rg.ConfigurationEndpoint?.Address) enriched["ConfigurationEndPoint.Address"] = rg.ConfigurationEndpoint.Address;
7564
+ if (rg.ConfigurationEndpoint?.Port !== void 0) enriched["ConfigurationEndPoint.Port"] = String(rg.ConfigurationEndpoint.Port);
7565
+ const readEndpoints = (rg.NodeGroups ?? []).flatMap((ng) => [ng.PrimaryEndpoint, ng.ReaderEndpoint]);
7566
+ const readAddrs = readEndpoints.map((ep) => ep?.Address).filter((a) => typeof a === "string" && a.length > 0);
7567
+ const readPorts = readEndpoints.map((ep) => ep?.Port).filter((p) => p !== void 0);
7568
+ if (readAddrs.length > 0) enriched["ReadEndPoint.Addresses"] = readAddrs.join(",");
7569
+ if (readPorts.length > 0) enriched["ReadEndPoint.Ports"] = readPorts.map(String).join(",");
7570
+ this.logger.debug(`Enriched ElastiCache ReplicationGroup ${physicalId} with endpoint attributes from DescribeReplicationGroups`);
7571
+ }
7572
+ } catch (error) {
7573
+ this.logger.debug(`Failed to enrich ElastiCache ReplicationGroup ${physicalId}: ${error instanceof Error ? error.message : String(error)}`);
7574
+ }
7575
+ break;
7553
7576
  default: break;
7554
7577
  }
7555
7578
  return enriched;
@@ -11624,7 +11647,8 @@ const RETRYABLE_ERROR_MESSAGE_PATTERNS = [
11624
11647
  "Could not deliver test message",
11625
11648
  "wait 60 seconds",
11626
11649
  "concurrent update operation",
11627
- "because it is in use"
11650
+ "because it is in use",
11651
+ "Rate exceeded"
11628
11652
  ];
11629
11653
  /**
11630
11654
  * HTTP status codes that always indicate a transient failure worth retrying.
@@ -11632,18 +11656,62 @@ const RETRYABLE_ERROR_MESSAGE_PATTERNS = [
11632
11656
  */
11633
11657
  const RETRYABLE_HTTP_STATUS_CODES = new Set([429, 503]);
11634
11658
  /**
11659
+ * AWS SDK v3 canonical throttling error names. Mirrors
11660
+ * `@aws-sdk/service-error-classification`'s `THROTTLING_ERROR_CODES` — any
11661
+ * error (or wrapped cause) whose `name` is one of these is a transient rate-
11662
+ * limit rejection worth retrying with backoff. Detecting by NAME is more
11663
+ * robust than by HTTP status because most AWS throttles surface as HTTP 400
11664
+ * (not 429) with the throttling signal carried only in the error code / name
11665
+ * (e.g. SSM `ThrottlingException` for the `Rate exceeded` message).
11666
+ */
11667
+ const THROTTLING_ERROR_NAMES = new Set([
11668
+ "BandwidthLimitExceeded",
11669
+ "EC2ThrottledException",
11670
+ "LimitExceededException",
11671
+ "PriorRequestNotComplete",
11672
+ "ProvisionedThroughputExceededException",
11673
+ "RequestLimitExceeded",
11674
+ "RequestThrottled",
11675
+ "RequestThrottledException",
11676
+ "SlowDown",
11677
+ "ThrottledException",
11678
+ "Throttling",
11679
+ "ThrottlingException",
11680
+ "TooManyRequestsException",
11681
+ "TransactionInProgressException"
11682
+ ]);
11683
+ /**
11684
+ * Walk the error + its `.cause` chain (bounded) looking for an AWS SDK v3
11685
+ * throttling error `name`. cdkd wraps the original AWS error in a
11686
+ * `ProvisioningError`, so the throttling signal is typically one cause-link
11687
+ * deep; the bounded walk also tolerates SDK errors that nest a `$response`/
11688
+ * cause without exploding on a cyclic chain.
11689
+ */
11690
+ function isThrottlingError(error) {
11691
+ let current = error;
11692
+ for (let depth = 0; depth < 5 && current != null; depth++) {
11693
+ const name = current.name;
11694
+ if (typeof name === "string" && THROTTLING_ERROR_NAMES.has(name)) return true;
11695
+ current = current.cause;
11696
+ }
11697
+ return false;
11698
+ }
11699
+ /**
11635
11700
  * Determine whether an AWS error should be retried.
11636
11701
  *
11637
11702
  * Checks (in order):
11638
11703
  * 1. HTTP status code on the error itself (`$metadata.httpStatusCode`)
11639
11704
  * 2. HTTP status code on a wrapped cause (`cause.$metadata.httpStatusCode`)
11640
- * 3. Substring match against {@link RETRYABLE_ERROR_MESSAGE_PATTERNS}
11705
+ * 3. Throttling error `name` on the error or any wrapped cause (most AWS
11706
+ * throttles are HTTP 400, not 429 — see {@link THROTTLING_ERROR_NAMES})
11707
+ * 4. Substring match against {@link RETRYABLE_ERROR_MESSAGE_PATTERNS}
11641
11708
  */
11642
11709
  function isRetryableTransientError(error, message) {
11643
11710
  const statusCode = error.$metadata?.httpStatusCode;
11644
11711
  if (statusCode !== void 0 && RETRYABLE_HTTP_STATUS_CODES.has(statusCode)) return true;
11645
11712
  const causeStatus = error.cause?.$metadata?.httpStatusCode;
11646
11713
  if (causeStatus !== void 0 && RETRYABLE_HTTP_STATUS_CODES.has(causeStatus)) return true;
11714
+ if (isThrottlingError(error)) return true;
11647
11715
  return RETRYABLE_ERROR_MESSAGE_PATTERNS.some((p) => message.includes(p));
11648
11716
  }
11649
11717
 
@@ -13095,4 +13163,4 @@ var DeployEngine = class {
13095
13163
 
13096
13164
  //#endregion
13097
13165
  export { AssemblyReader as $, shouldRetainResource as A, getDefaultStateBucketName as B, applyRoleArnIfSet as C, LockManager as D, TemplateParser as E, formatDockerLoginError as F, resolveStateBucketWithDefault as G, resolveApp as H, getDockerCmd as I, CFN_TEMPLATE_BODY_LIMIT as J, resolveStateBucketWithDefaultAndSource as K, runDockerForeground as L, stringifyValue as M, WorkGraph as N, S3StateBackend as O, buildDockerImage as P, uploadCfnTemplate as Q, runDockerStreaming as R, IntrinsicFunctionResolver as S, DagBuilder as T, resolveCaptureObservedState as U, getLegacyStateBucketName as V, resolveSkipPrefix as W, MIGRATE_TMP_PREFIX as X, CFN_TEMPLATE_URL_LIMIT as Y, findLargeInlineResources as Z, IAMRoleProvider as _, withRetry as a, findActionableSilentDrops as b, computeImplicitDeleteEdges as c, bold as d, clearBucketRegionCache as et, cyan as f, yellow as g, red as h, withResourceDeadline as i, AssetPublisher as j, rebuildClientForBucketRegion as k, extractDeploymentEventError as l, green as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, isRetryableTransientError as o, gray as p, warnDeprecatedNoPrefixCliFlag as q, DeployEngine as r, IMPLICIT_DELETE_DEPENDENCIES as s, DEFAULT_RESOURCE_TIMEOUT_MS as t, resolveBucketRegion as tt, formatResourceLine as u, collectInlinePolicyNamesManagedBySiblings as v, DiffCalculator as w, CloudControlProvider as x, ProviderRegistry as y, Synthesizer as z };
13098
- //# sourceMappingURL=deploy-engine-U63EpLKn.js.map
13166
+ //# sourceMappingURL=deploy-engine-DZLu8l6Z.js.map