@go-to-k/cdkd 0.282.4 → 0.282.5

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.
@@ -2573,6 +2573,39 @@ const PARTITION_TABLE = [
2573
2573
  }
2574
2574
  ];
2575
2575
  /**
2576
+ * Fold an AWS region name to its canonical lower-case spelling.
2577
+ *
2578
+ * AWS region ids ARE lower case — `${AWS::Region}` always returns that form —
2579
+ * but nothing between a `--region` flag and an SDK client enforces it, and
2580
+ * essentially everything downstream is case-SENSITIVE (issue
2581
+ * [#1795](https://github.com/go-to-k/cdkd/issues/1795)):
2582
+ *
2583
+ * - This module's own `PARTITION_TABLE` walk is a `startsWith` prefix test, so
2584
+ * `--region CN-NORTH-1` fell through to the commercial partition and the
2585
+ * `cdkd local *` commands synthesized
2586
+ * `<acct>.dkr.ecr.CN-NORTH-1.amazonaws.com/...` — a `cn-` region carrying the
2587
+ * commercial suffix, a host that does not exist.
2588
+ * - The AWS SDK's endpoint resolution is case-sensitive in the SAME direction.
2589
+ * Measured against this repo's vendored `@aws-sdk/util-endpoints` partition
2590
+ * data: `cn-north-1` resolves `aws-cn` / `amazonaws.com.cn` while
2591
+ * `CN-NORTH-1` resolves `aws` / `amazonaws.com` (both the exact-match table
2592
+ * and the `regionRegex` fallback are case-sensitive). So EVERY SDK client
2593
+ * built from a raw region — `STSClient` for `${AWS::AccountId}`, the ECR /
2594
+ * SecretsManager / SSM clients further down the `cdkd local` path — talks to
2595
+ * the wrong partition's endpoint and fails.
2596
+ * - `${AWS::Region}` substituted from a raw value spells the region wrongly
2597
+ * inside every ARN the resolver builds from it.
2598
+ *
2599
+ * Applied BOTH in `derivePartitionAndUrlSuffix` (so any caller of the mapping
2600
+ * inherits it) AND at the `cdkd local *` region-resolution points (so the
2601
+ * region VALUE those commands hand to SDK clients and to `${AWS::Region}` is
2602
+ * canonical too). Double-folding is a no-op, which is what makes having it in
2603
+ * both places safe rather than redundant.
2604
+ */
2605
+ function canonicalizeRegion(region) {
2606
+ return typeof region === "string" ? region.toLowerCase() : region;
2607
+ }
2608
+ /**
2576
2609
  * Derive the AWS partition / URL suffix for an AWS region. Same mapping
2577
2610
  * CloudFormation applies to `${AWS::Partition}` / `${AWS::URLSuffix}`.
2578
2611
  *
@@ -2583,9 +2616,24 @@ const PARTITION_TABLE = [
2583
2616
  * the COMMERCIAL suffix, so `parseEcrRegistryHost` (`src/utils/ecr-uri.ts`)
2584
2617
  * rejected it under the strict host check issue #1758 added and the image was
2585
2618
  * classified `public` — anonymous pull, no `docker login`, opaque failure.
2619
+ *
2620
+ * The region is CANONICALIZED through {@link canonicalizeRegion} before the
2621
+ * prefix tests (issue [#1795](https://github.com/go-to-k/cdkd/issues/1795)),
2622
+ * so every present and future caller inherits ONE normalization point and the
2623
+ * three `cdkd local *` call sites cannot drift apart again.
2624
+ *
2625
+ * This is only HALF the answer at those call sites, and the half it is NOT is
2626
+ * worth stating: canonicalizing here fixes the derived SUFFIX, but each caller
2627
+ * also passes the raw region VALUE to its SDK clients and stores it as
2628
+ * `${AWS::Region}`. The AWS SDK's own endpoint resolution is case-sensitive in
2629
+ * exactly the same way (measured against this repo's vendored
2630
+ * `@aws-sdk/util-endpoints` partition data: `CN-NORTH-1` resolves to the
2631
+ * COMMERCIAL `amazonaws.com`), so the callers canonicalize the value too — see
2632
+ * `canonicalizeRegion`'s own note.
2586
2633
  */
2587
2634
  function derivePartitionAndUrlSuffix(region) {
2588
- for (const { prefix, partition, urlSuffix } of PARTITION_TABLE) if (region.startsWith(prefix)) return {
2635
+ const canonical = canonicalizeRegion(region);
2636
+ for (const { prefix, partition, urlSuffix } of PARTITION_TABLE) if (canonical.startsWith(prefix)) return {
2589
2637
  partition,
2590
2638
  urlSuffix
2591
2639
  };
@@ -13754,7 +13802,7 @@ var CloudControlProvider = class {
13754
13802
  if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
13755
13803
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
13756
13804
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
13757
- const { ASGProvider } = await import("./asg-provider-D9VJTwn3.js").then((n) => n.n);
13805
+ const { ASGProvider } = await import("./asg-provider-Dl8-YYQR.js").then((n) => n.n);
13758
13806
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
13759
13807
  return;
13760
13808
  }
@@ -20671,7 +20719,7 @@ const FLUSH_INTERVAL_MS = 2e3;
20671
20719
  const FLUSH_EVENT_THRESHOLD = 50;
20672
20720
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
20673
20721
  function getCdkdVersion() {
20674
- return "0.282.4";
20722
+ return "0.282.5";
20675
20723
  }
20676
20724
  /**
20677
20725
  * Generate a time-sortable unique run id, e.g.
@@ -22839,5 +22887,5 @@ var DeployEngine = class {
22839
22887
  };
22840
22888
 
22841
22889
  //#endregion
22842
- export { configStringRefusal as $, resolveUseCdkBootstrapAssets as $t, green as A, ProvisioningError as An, BOOTSTRAP_MARKER_PREFIX as At, slowCcOperationTimeoutMs as B, withErrorHandling as Bn, runDockerStreaming as Bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as C, LocalInvokeBuildError as Cn, stringifyValue as Ct, bold as D, MissingCdkCliError as Dn, loadPublishableAssetManifest as Dt, formatResourceLine as E, LockError as En, createAssetRedirectResolver as Et, clearOnUpdateRemoval as F, StateError as Fn, validateContainerRepoName as Ft, getAccountInfo as G, getDefaultStateBucketName as Gt, isTerminationProtectionPropagationError as H, getDockerImageBySourceHash as Ht, ProviderRegistry as I, SynthesisError as In, buildDockerImage as It, normalizeAwsTagsToCfn as J, resolveAutoAssetStorage as Jt, refStateLookupFromResource as K, getLegacyStateBucketName as Kt, findActionableSilentDrops as L, formatError as Ln, formatDockerLoginError as Lt, yellow as M, ResourceUpdateNotSupportedError as Mn, getBootstrapMarkerKey as Mt, IAMRoleProvider as N, StackHasActiveImportsError as Nn, parseBootstrapMarker as Nt, cyan as O, NestedStackChildDirectDestroyError as On, rewriteTemplateAssetReferences as Ot, collectInlinePolicyNamesManagedBySiblings as P, StackTerminationProtectionError as Pn, validateAssetBucketName as Pt, configBooleanRefusal as Q, resolveStateBucketWithDefaultAndSource as Qt, findSilentDropProperties as R, isCdkdError as Rn, getDockerCmd as Rt, extractDeploymentEventError as S, DeployCancelledError as Sn, AssetPublisher as St, renderStatefulReason as T, LocalStartServiceError as Tn, buildAssetRedirectMap as Tt, IntrinsicFunctionResolver as U, Synthesizer as Ut, disableInstanceApiTermination as V, __exportAll as Vn, AssetManifestLoader as Vt, cfnRefValueFromPhysicalId as W, synthesisStatusMessage as Wt, assertRegionMatch as X, resolveSkipPrefix as Xt, resolveExplicitPhysicalId as Y, resolveCaptureObservedState as Yt, coerceCfnBoolean as Z, resolveStateBucketWithDefault as Zt, createPreDeleteFinalSnapshot as _, setAwsClients as _n, TemplateParser as _t, DeploymentEventsStore as a, findLargeInlineResources as an, s3BucketArn as at, unsupportedFinalSnapshotError as b, ConfigError as bn, rebuildClientForBucketRegion as bt, replayFailedOperations as c, PARTITION_TABLE as cn, s3BucketRegionalDomainName as ct, IMPLICIT_DELETE_DEPENDENCIES as d, processStackMessages as dn, DiffCalculator as dt, stateBucketExistenceConfirmed as en, readConfigString as et, computeImplicitDeleteEdges as f, clearBucketRegionCache as fn, describeTypeWithThrottleRetry as ft, ccRoutedFinalSnapshotError as g, resetAwsClients as gn, DagBuilder as gt, buildFinalSnapshotIdentifier as h, getAwsClients as hn, isThrottlingError as ht, DeploymentEventsReader as i, MIGRATE_TMP_PREFIX as in, requireConfigString as it, red as j, ResourceTimeoutError as jn, ensureAssetStorage as jt, gray as k, PartialFailureError as kn, AssetModeResolver as kt, replayRollback as l, derivePartitionAndUrlSuffix as ln, s3BucketWebsiteUrl as lt, PRE_DELETE_SNAPSHOT_TYPES as m, AwsClients as mn, isRetryableTransientError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, CFN_TEMPLATE_BODY_LIMIT as nn, requireConfigArray as nt, planFailedOps as o, uploadCfnTemplate as on, s3BucketDomainName as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, resolveBucketRegion as pn, withRetry as pt, WAFv2WebACLProvider as q, resolveApp as qt, DeployEngine as r, CFN_TEMPLATE_URL_LIMIT as rn, requireConfigObject as rt, planRollback as s, expectedOwnerParam as sn, s3BucketDualStackDomainName as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, warnDeprecatedNoPrefixCliFlag as tn, replayWarn as tt, withResourceDeadline as u, AssemblyReader as un, applyRoleArnIfSet as ut, isFinalSnapshotError as v, AssetError as vn, LockManager as vt, isStatefulRecreateTargetSync as w, LocalMigrateError as wn, WorkGraph as wt, makeCanonicalizePropertiesFn as x, DependencyError as xn, shouldRetainResource as xt, refusesFinalSnapshot as y, CdkdError as yn, S3StateBackend as yt, CloudControlProvider as z, normalizeAwsError as zn, runDockerForeground as zt };
22843
- //# sourceMappingURL=deploy-engine-CnxJLy3Y.js.map
22890
+ export { configStringRefusal as $, resolveUseCdkBootstrapAssets as $t, green as A, PartialFailureError as An, BOOTSTRAP_MARKER_PREFIX as At, slowCcOperationTimeoutMs as B, normalizeAwsError as Bn, runDockerStreaming as Bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as C, DeployCancelledError as Cn, stringifyValue as Ct, bold as D, LockError as Dn, loadPublishableAssetManifest as Dt, formatResourceLine as E, LocalStartServiceError as En, createAssetRedirectResolver as Et, clearOnUpdateRemoval as F, StackTerminationProtectionError as Fn, validateContainerRepoName as Ft, getAccountInfo as G, getDefaultStateBucketName as Gt, isTerminationProtectionPropagationError as H, __exportAll as Hn, getDockerImageBySourceHash as Ht, ProviderRegistry as I, StateError as In, buildDockerImage as It, normalizeAwsTagsToCfn as J, resolveAutoAssetStorage as Jt, refStateLookupFromResource as K, getLegacyStateBucketName as Kt, findActionableSilentDrops as L, SynthesisError as Ln, formatDockerLoginError as Lt, yellow as M, ResourceTimeoutError as Mn, getBootstrapMarkerKey as Mt, IAMRoleProvider as N, ResourceUpdateNotSupportedError as Nn, parseBootstrapMarker as Nt, cyan as O, MissingCdkCliError as On, rewriteTemplateAssetReferences as Ot, collectInlinePolicyNamesManagedBySiblings as P, StackHasActiveImportsError as Pn, validateAssetBucketName as Pt, configBooleanRefusal as Q, resolveStateBucketWithDefaultAndSource as Qt, findSilentDropProperties as R, formatError as Rn, getDockerCmd as Rt, extractDeploymentEventError as S, DependencyError as Sn, AssetPublisher as St, renderStatefulReason as T, LocalMigrateError as Tn, buildAssetRedirectMap as Tt, IntrinsicFunctionResolver as U, Synthesizer as Ut, disableInstanceApiTermination as V, withErrorHandling as Vn, AssetManifestLoader as Vt, cfnRefValueFromPhysicalId as W, synthesisStatusMessage as Wt, assertRegionMatch as X, resolveSkipPrefix as Xt, resolveExplicitPhysicalId as Y, resolveCaptureObservedState as Yt, coerceCfnBoolean as Z, resolveStateBucketWithDefault as Zt, createPreDeleteFinalSnapshot as _, resetAwsClients as _n, TemplateParser as _t, DeploymentEventsStore as a, findLargeInlineResources as an, s3BucketArn as at, unsupportedFinalSnapshotError as b, CdkdError as bn, rebuildClientForBucketRegion as bt, replayFailedOperations as c, PARTITION_TABLE as cn, s3BucketRegionalDomainName as ct, IMPLICIT_DELETE_DEPENDENCIES as d, AssemblyReader as dn, DiffCalculator as dt, stateBucketExistenceConfirmed as en, readConfigString as et, computeImplicitDeleteEdges as f, processStackMessages as fn, describeTypeWithThrottleRetry as ft, ccRoutedFinalSnapshotError as g, getAwsClients as gn, DagBuilder as gt, buildFinalSnapshotIdentifier as h, AwsClients as hn, isThrottlingError as ht, DeploymentEventsReader as i, MIGRATE_TMP_PREFIX as in, requireConfigString as it, red as j, ProvisioningError as jn, ensureAssetStorage as jt, gray as k, NestedStackChildDirectDestroyError as kn, AssetModeResolver as kt, replayRollback as l, canonicalizeRegion as ln, s3BucketWebsiteUrl as lt, PRE_DELETE_SNAPSHOT_TYPES as m, resolveBucketRegion as mn, isRetryableTransientError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, CFN_TEMPLATE_BODY_LIMIT as nn, requireConfigArray as nt, planFailedOps as o, uploadCfnTemplate as on, s3BucketDomainName as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, clearBucketRegionCache as pn, withRetry as pt, WAFv2WebACLProvider as q, resolveApp as qt, DeployEngine as r, CFN_TEMPLATE_URL_LIMIT as rn, requireConfigObject as rt, planRollback as s, expectedOwnerParam as sn, s3BucketDualStackDomainName as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, warnDeprecatedNoPrefixCliFlag as tn, replayWarn as tt, withResourceDeadline as u, derivePartitionAndUrlSuffix as un, applyRoleArnIfSet as ut, isFinalSnapshotError as v, setAwsClients as vn, LockManager as vt, isStatefulRecreateTargetSync as w, LocalInvokeBuildError as wn, WorkGraph as wt, makeCanonicalizePropertiesFn as x, ConfigError as xn, shouldRetainResource as xt, refusesFinalSnapshot as y, AssetError as yn, S3StateBackend as yt, CloudControlProvider as z, isCdkdError as zn, runDockerForeground as zt };
22891
+ //# sourceMappingURL=deploy-engine-Cg_wFdJP.js.map