@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.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as configStringRefusal, $t as resolveUseCdkBootstrapAssets, A as green, An as ProvisioningError, At as BOOTSTRAP_MARKER_PREFIX, B as slowCcOperationTimeoutMs, Bn as withErrorHandling, Bt as runDockerStreaming, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Cn as LocalInvokeBuildError$1, Ct as stringifyValue, D as bold, Dn as MissingCdkCliError, Dt as loadPublishableAssetManifest, E as formatResourceLine, Et as createAssetRedirectResolver, F as clearOnUpdateRemoval, Ft as validateContainerRepoName, G as getAccountInfo, Gt as getDefaultStateBucketName, H as isTerminationProtectionPropagationError, Ht as getDockerImageBySourceHash, I as ProviderRegistry, It as buildDockerImage, J as normalizeAwsTagsToCfn, Jt as resolveAutoAssetStorage, K as refStateLookupFromResource, Kt as getLegacyStateBucketName, L as findActionableSilentDrops, Lt as formatDockerLoginError, M as yellow, Mn as ResourceUpdateNotSupportedError, Mt as getBootstrapMarkerKey, N as IAMRoleProvider, Nn as StackHasActiveImportsError, Nt as parseBootstrapMarker, O as cyan, On as NestedStackChildDirectDestroyError, Ot as rewriteTemplateAssetReferences, P as collectInlinePolicyNamesManagedBySiblings, Pn as StackTerminationProtectionError, Pt as validateAssetBucketName, Q as configBooleanRefusal, Qt as resolveStateBucketWithDefaultAndSource, R as findSilentDropProperties, Rt as getDockerCmd, S as extractDeploymentEventError, Sn as DeployCancelledError, St as AssetPublisher, T as renderStatefulReason, Tn as LocalStartServiceError, Tt as buildAssetRedirectMap, U as IntrinsicFunctionResolver, Ut as Synthesizer, V as disableInstanceApiTermination, Vt as AssetManifestLoader, W as cfnRefValueFromPhysicalId, Wt as synthesisStatusMessage, X as assertRegionMatch, Xt as resolveSkipPrefix, Y as resolveExplicitPhysicalId, Yt as resolveCaptureObservedState, Z as coerceCfnBoolean, Zt as resolveStateBucketWithDefault, _ as createPreDeleteFinalSnapshot, _n as setAwsClients, _t as TemplateParser, a as DeploymentEventsStore, an as findLargeInlineResources, at as s3BucketArn, b as unsupportedFinalSnapshotError, bt as rebuildClientForBucketRegion, c as replayFailedOperations, cn as PARTITION_TABLE, ct as s3BucketRegionalDomainName, d as IMPLICIT_DELETE_DEPENDENCIES, dn as processStackMessages, dt as DiffCalculator, en as stateBucketExistenceConfirmed, et as readConfigString, f as computeImplicitDeleteEdges, ft as describeTypeWithThrottleRetry, g as ccRoutedFinalSnapshotError, gn as resetAwsClients, gt as DagBuilder, h as buildFinalSnapshotIdentifier, hn as getAwsClients, ht as isThrottlingError, i as DeploymentEventsReader, in as MIGRATE_TMP_PREFIX, it as requireConfigString, j as red, jn as ResourceTimeoutError, jt as ensureAssetStorage, k as gray, kn as PartialFailureError, kt as AssetModeResolver, l as replayRollback, ln as derivePartitionAndUrlSuffix, lt as s3BucketWebsiteUrl, m as PRE_DELETE_SNAPSHOT_TYPES, mn as AwsClients, mt as isRetryableTransientError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as CFN_TEMPLATE_BODY_LIMIT, nt as requireConfigArray, o as planFailedOps, on as uploadCfnTemplate, ot as s3BucketDomainName, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as resolveBucketRegion, pt as withRetry, q as WAFv2WebACLProvider, qt as resolveApp, r as DeployEngine, rn as CFN_TEMPLATE_URL_LIMIT, rt as requireConfigObject, s as planRollback, sn as expectedOwnerParam, st as s3BucketDualStackDomainName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as warnDeprecatedNoPrefixCliFlag, tt as replayWarn, u as withResourceDeadline, un as AssemblyReader, ut as applyRoleArnIfSet, v as isFinalSnapshotError, vt as LockManager, w as isStatefulRecreateTargetSync, wn as LocalMigrateError, wt as WorkGraph, x as makeCanonicalizePropertiesFn, xt as shouldRetainResource, y as refusesFinalSnapshot, yn as CdkdError, yt as S3StateBackend, z as CloudControlProvider, zn as normalizeAwsError, zt as runDockerForeground } from "./deploy-engine-CnxJLy3Y.js";
2
+ import { $ as configStringRefusal, $t as resolveUseCdkBootstrapAssets, A as green, An as PartialFailureError, At as BOOTSTRAP_MARKER_PREFIX, B as slowCcOperationTimeoutMs, Bn as normalizeAwsError, Bt as runDockerStreaming, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Cn as DeployCancelledError, Ct as stringifyValue, D as bold, Dt as loadPublishableAssetManifest, E as formatResourceLine, En as LocalStartServiceError, Et as createAssetRedirectResolver, F as clearOnUpdateRemoval, Fn as StackTerminationProtectionError, Ft as validateContainerRepoName, G as getAccountInfo, Gt as getDefaultStateBucketName, H as isTerminationProtectionPropagationError, Ht as getDockerImageBySourceHash, I as ProviderRegistry, It as buildDockerImage, J as normalizeAwsTagsToCfn, Jt as resolveAutoAssetStorage, K as refStateLookupFromResource, Kt as getLegacyStateBucketName, L as findActionableSilentDrops, Lt as formatDockerLoginError, M as yellow, Mn as ResourceTimeoutError, Mt as getBootstrapMarkerKey, N as IAMRoleProvider, Nn as ResourceUpdateNotSupportedError, Nt as parseBootstrapMarker, O as cyan, On as MissingCdkCliError, Ot as rewriteTemplateAssetReferences, P as collectInlinePolicyNamesManagedBySiblings, Pn as StackHasActiveImportsError, Pt as validateAssetBucketName, Q as configBooleanRefusal, Qt as resolveStateBucketWithDefaultAndSource, R as findSilentDropProperties, Rt as getDockerCmd, S as extractDeploymentEventError, St as AssetPublisher, T as renderStatefulReason, Tn as LocalMigrateError, Tt as buildAssetRedirectMap, U as IntrinsicFunctionResolver, Ut as Synthesizer, V as disableInstanceApiTermination, Vn as withErrorHandling, Vt as AssetManifestLoader, W as cfnRefValueFromPhysicalId, Wt as synthesisStatusMessage, X as assertRegionMatch, Xt as resolveSkipPrefix, Y as resolveExplicitPhysicalId, Yt as resolveCaptureObservedState, Z as coerceCfnBoolean, Zt as resolveStateBucketWithDefault, _ as createPreDeleteFinalSnapshot, _n as resetAwsClients, _t as TemplateParser, a as DeploymentEventsStore, an as findLargeInlineResources, at as s3BucketArn, b as unsupportedFinalSnapshotError, bn as CdkdError, bt as rebuildClientForBucketRegion, c as replayFailedOperations, cn as PARTITION_TABLE, ct as s3BucketRegionalDomainName, d as IMPLICIT_DELETE_DEPENDENCIES, dn as AssemblyReader, dt as DiffCalculator, en as stateBucketExistenceConfirmed, et as readConfigString, f as computeImplicitDeleteEdges, fn as processStackMessages, ft as describeTypeWithThrottleRetry, g as ccRoutedFinalSnapshotError, gn as getAwsClients, gt as DagBuilder, h as buildFinalSnapshotIdentifier, hn as AwsClients, ht as isThrottlingError, i as DeploymentEventsReader, in as MIGRATE_TMP_PREFIX, it as requireConfigString, j as red, jn as ProvisioningError, jt as ensureAssetStorage, k as gray, kn as NestedStackChildDirectDestroyError, kt as AssetModeResolver, l as replayRollback, ln as canonicalizeRegion, lt as s3BucketWebsiteUrl, m as PRE_DELETE_SNAPSHOT_TYPES, mn as resolveBucketRegion, mt as isRetryableTransientError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as CFN_TEMPLATE_BODY_LIMIT, nt as requireConfigArray, o as planFailedOps, on as uploadCfnTemplate, ot as s3BucketDomainName, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pt as withRetry, q as WAFv2WebACLProvider, qt as resolveApp, r as DeployEngine, rn as CFN_TEMPLATE_URL_LIMIT, rt as requireConfigObject, s as planRollback, sn as expectedOwnerParam, st as s3BucketDualStackDomainName, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as warnDeprecatedNoPrefixCliFlag, tt as replayWarn, u as withResourceDeadline, un as derivePartitionAndUrlSuffix, ut as applyRoleArnIfSet, v as isFinalSnapshotError, vn as setAwsClients, vt as LockManager, w as isStatefulRecreateTargetSync, wn as LocalInvokeBuildError$1, wt as WorkGraph, x as makeCanonicalizePropertiesFn, xt as shouldRetainResource, y as refusesFinalSnapshot, yt as S3StateBackend, z as CloudControlProvider, zt as runDockerForeground } from "./deploy-engine-Cg_wFdJP.js";
3
3
  import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, h as withStackName, i as runStackBuffered, m as withSkipPrefix, n as getLogger, o as PATTERN_B_NAME_OPTIONS, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-zRrlbaQt.js";
4
- import { t as ASGProvider } from "./asg-provider-D9VJTwn3.js";
4
+ import { t as ASGProvider } from "./asg-provider-Dl8-YYQR.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { createHash, randomBytes, randomUUID } from "node:crypto";
7
7
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -68399,20 +68399,64 @@ function ecrUrlSuffix(region) {
68399
68399
  return derivePartitionAndUrlSuffix(region).urlSuffix;
68400
68400
  }
68401
68401
  /**
68402
+ * Lower-case the REGISTRY HOST of an image reference and leave the repository
68403
+ * path and tag byte-identical.
68404
+ *
68405
+ * A registry host is a DNS name and therefore case-INSENSITIVE, but docker's
68406
+ * credential store is keyed on the hostname VERBATIM: measured against a real
68407
+ * daemon with a `DOCKER_CONFIG` holding auth for
68408
+ * `<acct>.dkr.ecr.us-east-1.amazonaws.com`, a pull of
68409
+ * `<acct>.dkr.ecr.US-EAST-1.amazonaws.com/...` sent NO credentials at all
68410
+ * (`no basic auth credentials`) while the lower-cased spelling authenticated
68411
+ * and failed with a token error instead. So cdkd logging in to one spelling
68412
+ * and pulling from another authenticates against neither.
68413
+ *
68414
+ * The repository path and tag are deliberately NOT folded: only the domain is
68415
+ * case-insensitive, docker already requires the path to be lower case, and
68416
+ * rewriting it would change WHICH image is pulled.
68417
+ *
68418
+ * "Everything before the first `/`" is NOT the same thing as "the host", which
68419
+ * is why the first component is tested rather than assumed. Docker treats it
68420
+ * as a registry only when it contains a `.` or a `:` or is exactly
68421
+ * `localhost`; otherwise it is the first segment of a Docker Hub repository
68422
+ * PATH (`MyOrg/MyRepo:tag` is `docker.io/MyOrg/MyRepo:tag`). Folding that
68423
+ * would name a DIFFERENT image. Today every caller is behind the strict ECR
68424
+ * host check so the distinction is inert, but this is exported under a generic
68425
+ * name and the contract has to be the real one.
68426
+ */
68427
+ function canonicalizeImageUriHost(imageUri) {
68428
+ const slash = imageUri.indexOf("/");
68429
+ if (slash < 0) return imageUri;
68430
+ const host = imageUri.slice(0, slash);
68431
+ if (!isRegistryHostComponent(host)) return imageUri;
68432
+ return host.toLowerCase() + imageUri.slice(slash);
68433
+ }
68434
+ /** Docker's rule for "component 1 is a registry, not a repository segment". */
68435
+ function isRegistryHostComponent(component) {
68436
+ return component.includes(".") || component.includes(":") || component === "localhost";
68437
+ }
68438
+ /**
68402
68439
  * Parse an ECR image URI. Returns `undefined` for non-ECR URIs (typically:
68403
68440
  * Docker Hub, public.ecr.aws, gcr.io, ...) — those are user-managed
68404
68441
  * images we don't try to authenticate against.
68442
+ *
68443
+ * The host is canonicalized BEFORE the registry-host match, so a mixed-case
68444
+ * genuine ECR host classifies as ECR (and its `region` comes back in the
68445
+ * spelling the ECR endpoint and the `docker login` both use) rather than
68446
+ * falling through to the anonymous-pull path.
68405
68447
  */
68406
68448
  function parseEcrUri(imageUri) {
68407
- const host = parseEcrRegistryHost(imageUri);
68449
+ const canonicalUri = canonicalizeImageUriHost(imageUri);
68450
+ const host = parseEcrRegistryHost(canonicalUri);
68408
68451
  if (!host) return void 0;
68409
- const m = /^([^:]+):(.+)$/.exec(imageUri.slice(imageUri.indexOf("/") + 1));
68452
+ const m = /^([^:]+):(.+)$/.exec(canonicalUri.slice(canonicalUri.indexOf("/") + 1));
68410
68453
  if (!m) return void 0;
68411
68454
  return {
68412
68455
  accountId: host.accountId,
68413
- region: host.region,
68456
+ region: canonicalizeRegion(host.region),
68414
68457
  repository: m[1],
68415
- tag: m[2]
68458
+ tag: m[2],
68459
+ canonicalUri
68416
68460
  };
68417
68461
  }
68418
68462
  /**
@@ -68452,17 +68496,24 @@ function isCredentialFresh(creds) {
68452
68496
  *
68453
68497
  * Auto-detects cross-account from `STS:GetCallerIdentity` and assumes
68454
68498
  * the supplied role when set. Returns the image URI the caller should
68455
- * pass to `docker run` (same as the input no rewriting).
68499
+ * pass to `docker run`: the input with its registry HOST lower-cased and
68500
+ * its repository path + tag untouched (issue #1801). That is the SAME
68501
+ * spelling `docker pull` / `docker image inspect` were handed here, and
68502
+ * the same one the DERIVED `docker login` endpoint names — an
68503
+ * AWS-reported `proxyEndpoint` still wins over that fallback (it can be
68504
+ * a VPC-endpoint host), which is correct: AWS names the endpoint its own
68505
+ * token authenticates, and it reports it lower-cased.
68456
68506
  */
68457
68507
  async function pullEcrImage(imageUri, options) {
68458
68508
  const logger = getLogger().child("ecr-puller");
68459
68509
  const parsed = parseEcrUri(imageUri);
68460
68510
  if (!parsed) throw new LocalInvokeBuildError$1(`Image URI '${imageUri}' is not an ECR URI. cdkd local invoke v1 only authenticates against ECR for the deployed-image fallback path.`);
68461
- const callerRegion = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"];
68511
+ const canonicalUri = parsed.canonicalUri;
68512
+ const callerRegion = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"]);
68462
68513
  if (options.skipPull) {
68463
- logger.info(`Skipping ECR pull (--no-pull). Verifying ${imageUri} is in local cache...`);
68464
- await verifyImageInLocalCache(imageUri);
68465
- return imageUri;
68514
+ logger.info(`Skipping ECR pull (--no-pull). Verifying ${canonicalUri} is in local cache...`);
68515
+ await verifyImageInLocalCache(canonicalUri);
68516
+ return canonicalUri;
68466
68517
  }
68467
68518
  const callerIdentityKey = callerRegion ?? "_unset";
68468
68519
  let callerAccount = CALLER_IDENTITY_CACHE.get(callerIdentityKey);
@@ -68502,13 +68553,13 @@ async function pullEcrImage(imageUri, options) {
68502
68553
  } finally {
68503
68554
  ecr.destroy();
68504
68555
  }
68505
- logger.info(`Pulling ${imageUri}...`);
68556
+ logger.info(`Pulling ${canonicalUri}...`);
68506
68557
  try {
68507
- await runDockerForeground(["pull", imageUri]);
68558
+ await runDockerForeground(["pull", canonicalUri]);
68508
68559
  } catch (err) {
68509
- throw new LocalInvokeBuildError$1(`docker pull ${imageUri} failed: ${err.message}`);
68560
+ throw new LocalInvokeBuildError$1(`docker pull ${canonicalUri} failed: ${err.message}`);
68510
68561
  }
68511
- return imageUri;
68562
+ return canonicalUri;
68512
68563
  }
68513
68564
  /**
68514
68565
  * Assume the supplied role via the SDK default credential chain and
@@ -69722,6 +69773,7 @@ function clampConcurrency(input) {
69722
69773
  async function localStartApiCommand(target, options) {
69723
69774
  const logger = getLogger();
69724
69775
  if (options.verbose) logger.setLevel("debug");
69776
+ if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
69725
69777
  let apiFilter = target;
69726
69778
  if (options.api !== void 0) {
69727
69779
  if (target !== void 0) throw new Error(`Cannot specify both positional target ('${target}') and --api flag ('${options.api}'). Use one or the other. The positional form is preferred — '--api' is a deprecated alias.`);
@@ -71128,10 +71180,18 @@ async function loadStateForRoutedStacks(stacks, routes, routesWithAuth, options)
71128
71180
  *
71129
71181
  * Region precedence: `--region` > `AWS_REGION` > `AWS_DEFAULT_REGION` >
71130
71182
  * the state record's region (returned by the active `LocalStateProvider`).
71183
+ *
71184
+ * The resolved region is CANONICALIZED (issue #1795) before anything consumes
71185
+ * it. That covers all four sources — `--region`, both env vars, and the state
71186
+ * record's region — and all three consumers: the STS client built for
71187
+ * `${AWS::AccountId}`, the `${AWS::URLSuffix}` / `${AWS::Partition}`
71188
+ * derivation, and the `${AWS::Region}` value itself.
71189
+ *
71190
+ * @internal exported for unit tests.
71131
71191
  */
71132
71192
  async function resolvePseudoParametersForStartApi(stateRegion, options) {
71133
71193
  const logger = getLogger();
71134
- const region = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? stateRegion;
71194
+ const region = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? stateRegion);
71135
71195
  let accountId;
71136
71196
  try {
71137
71197
  const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
@@ -72055,6 +72115,7 @@ async function localRunTaskCommand(target, options) {
72055
72115
  const logger = getLogger();
72056
72116
  if (options.verbose) logger.setLevel("debug");
72057
72117
  warnIfDeprecatedRegion(options);
72118
+ if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
72058
72119
  const state = createEcsRunState();
72059
72120
  let sigintHandler;
72060
72121
  let sigintCount = 0;
@@ -72224,6 +72285,14 @@ async function assumeTaskRole(roleArn, region) {
72224
72285
  * load) routes through the active {@link LocalStateProvider} so both
72225
72286
  * `--from-state` and `--from-cfn-stack` produce the same downstream
72226
72287
  * context shape (issue #606).
72288
+ *
72289
+ * The resolved region is CANONICALIZED (issue #1795) before anything consumes
72290
+ * it. That covers all four sources — `--region`, both env vars, and the
72291
+ * synth-derived stack region — and all three consumers: the STS client built
72292
+ * for `${AWS::AccountId}`, the `${AWS::URLSuffix}` / `${AWS::Partition}`
72293
+ * derivation, and the `${AWS::Region}` value itself.
72294
+ *
72295
+ * @internal exported for unit tests.
72227
72296
  */
72228
72297
  async function buildEcsImageResolutionContext$1(candidate, stateProvider, options) {
72229
72298
  const logger = getLogger();
@@ -72233,7 +72302,7 @@ async function buildEcsImageResolutionContext$1(candidate, stateProvider, option
72233
72302
  const ctx = {};
72234
72303
  const wantsPseudoForEnvOrSecret = !!stateProvider && needs.needsEnvOrSecretSubstitution;
72235
72304
  if (needs.needsPseudoParameters || wantsPseudoForEnvOrSecret) {
72236
- const region = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? candidate.region;
72305
+ const region = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? candidate.region);
72237
72306
  if (!region) logger.warn("Resolver references ${AWS::Region} but cdkd could not determine the target region. Pass --region, set AWS_REGION, or declare env.region on the CDK stack.");
72238
72307
  let accountId;
72239
72308
  try {
@@ -73901,6 +73970,7 @@ async function localInvokeCommand(target, options) {
73901
73970
  const logger = getLogger();
73902
73971
  if (options.verbose) logger.setLevel("debug");
73903
73972
  warnIfDeprecatedRegion(options);
73973
+ if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
73904
73974
  let imagePlan;
73905
73975
  let containerId;
73906
73976
  let stopLogs;
@@ -74381,10 +74451,18 @@ function envHasCrossStackIntrinsic(templateEnv) {
74381
74451
  *
74382
74452
  * Region precedence (mirrors `local-run-task`): `--region` > `AWS_REGION`
74383
74453
  * > `AWS_DEFAULT_REGION` > the synth-derived stack region.
74454
+ *
74455
+ * The resolved region is CANONICALIZED (issue #1795) before anything consumes
74456
+ * it. That covers all four sources — `--region`, both env vars, and the
74457
+ * synth-derived stack region — and all three consumers: the STS client built
74458
+ * for `${AWS::AccountId}`, the `${AWS::URLSuffix}` / `${AWS::Partition}`
74459
+ * derivation, and the `${AWS::Region}` value itself.
74460
+ *
74461
+ * @internal exported for unit tests.
74384
74462
  */
74385
74463
  async function resolvePseudoParametersForInvoke(stackRegion, options) {
74386
74464
  const logger = getLogger();
74387
- const region = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? stackRegion;
74465
+ const region = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? stackRegion);
74388
74466
  if (!region) logger.warn("--from-state: resolver references ${AWS::Region} but cdkd could not determine the target region. Pass --region, set AWS_REGION, or declare env.region on the CDK stack.");
74389
74467
  let accountId;
74390
74468
  try {
@@ -75763,7 +75841,7 @@ function createMigrateCommand() {
75763
75841
  */
75764
75842
  function buildProgram() {
75765
75843
  const program = new Command();
75766
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.282.4");
75844
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.282.5");
75767
75845
  program.hook("preAction", (_thisCommand, actionCommand) => {
75768
75846
  const { profile } = actionCommand.optsWithGlobals();
75769
75847
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;