@go-to-k/cdkd 0.284.45 → 0.284.47

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.
@@ -14555,9 +14555,66 @@ const cachedEc2InstanceAttributes = {};
14555
14555
  *
14556
14556
  * Kept as one helper so the cached and the freshly-resolved paths cannot pick
14557
14557
  * different defaults (issue #1746).
14558
+ *
14559
+ * FOLDED here, at the source, rather than at each consumer (issue
14560
+ * [#1882](https://github.com/go-to-k/cdkd/issues/1882)). This is the value
14561
+ * `AWS::Region` returns, the value every `Fn::Sub` in a USER template
14562
+ * interpolates, and the `region-name` filter `resolveGetAZs` sends to EC2 when
14563
+ * the template names no region — three consumers with three different
14564
+ * case-sensitivities, which is why folding at the read beats folding at each of
14565
+ * them.
14566
+ *
14567
+ * #1882 held this raw pending a live CloudFormation A/B, on the reasoning that
14568
+ * `AWS::Region` is CFn's own passthrough and a user may legitimately read it
14569
+ * back. The A/B was run on 2026-08-25 and removes the premise rather than
14570
+ * answering it: a non-canonical region never reaches CloudFormation at all,
14571
+ * because SigV4's credential scope is compared case-sensitively by the service.
14572
+ * Measured against this repo's vendored SDK, every spelling but the canonical
14573
+ * one is refused before the request is served:
14574
+ *
14575
+ * ```text
14576
+ * STSClient({region:'us-east-1'}).send(GetCallerIdentity) -> OK
14577
+ * STSClient({region:'US-EAST-1'}).send(GetCallerIdentity) -> SignatureDoesNotMatch
14578
+ * STSClient({region:'Us-East-1'}).send(GetCallerIdentity) -> SignatureDoesNotMatch
14579
+ * CloudFormationClient({region:'US-EAST-1'}).send(ListStacks) -> SignatureDoesNotMatch
14580
+ * "Credential should be scoped to a valid region."
14581
+ * ```
14582
+ *
14583
+ * Two routes a raw region could take are therefore closed BEFORE this function:
14584
+ * `--region` / `AWS_REGION` are folded at the CLI boundary (`foldRegionOption`,
14585
+ * issue #2065), and a CDK app declaring `env: { region: 'US-EAST-1' }` fails at
14586
+ * `app.synth()` — `EnvironmentUtils.parse` is case-sensitive, measured on
14587
+ * aws-cdk-lib 2.244.0.
14588
+ *
14589
+ * What is NOT closed, and is the reason this fold is more than tidiness: a Cloud
14590
+ * Assembly that reaches cdkd with a raw region in its `environment` string.
14591
+ * cdkd's own `parseEnvironment` (`src/types/assembly.ts`) accepts any region
14592
+ * text, so a hand-authored assembly, a non-CDK toolchain, or a `cdk.out` left
14593
+ * behind by a synth that threw AFTER writing the manifest all reach
14594
+ * `stackInfo.region` unfolded, and `deploy.ts` passes it on as the resolver's
14595
+ * region. That deploy SUCCEEDS — `AwsClients`' constructor folds the region its
14596
+ * clients sign with, so SigV4 never sees the raw spelling — and every
14597
+ * `${AWS::Region}` a user's `Fn::Sub` interpolates inherits it, producing
14598
+ * `arn:aws:s3:US-EAST-1:...`, which no IAM policy matches, and persisting it,
14599
+ * while every ARN cdkd itself constructs beside it is canonical (issue #1850).
14600
+ * Folding here removes that self-contradiction.
14601
+ *
14602
+ * UPGRADE CONSEQUENCE, stated because #1850's own entry states it for its fold:
14603
+ * a stack deployed that way keeps the raw spelling in its recorded properties,
14604
+ * so the next diff of a property interpolating `${AWS::Region}` sees a change,
14605
+ * and where the property is create-only that classifies as a REPLACEMENT.
14606
+ * Deliberate — the recorded value is unusable, so converging it is the point.
14607
+ * State KEYS are unaffected: they are built from `stackRegion`, which this does
14608
+ * not touch.
14609
+ *
14610
+ * The consumer-side `canonicalizeRegion` calls this subsumes are deliberately
14611
+ * LEFT in place. Only `s3-endpoints.ts`'s is still reachable from a caller that
14612
+ * does not come through here; the rest are now genuinely redundant and are kept
14613
+ * as defense in depth, since double-folding is a no-op and a future caller may
14614
+ * reach them another way.
14558
14615
  */
14559
14616
  function effectiveAccountInfoRegion(overrideRegion) {
14560
- return overrideRegion || process.env["AWS_REGION"] || "us-east-1";
14617
+ return canonicalizeRegion(overrideRegion || process.env["AWS_REGION"]) || "us-east-1";
14561
14618
  }
14562
14619
  /**
14563
14620
  * Build the caller's full answer from the cached account identity (issue #1746).
@@ -16748,7 +16805,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
16748
16805
  if (typeof raw !== "string" || raw === "") throw new Error(`Fn::GetStackOutput: RoleArn must be a literal string in the template (no Ref / Fn::GetAtt / Fn::Sub allowed for cross-account references). Got ${raw === null ? "null" : Array.isArray(raw) ? "array" : typeof raw}${typeof raw === "object" ? ` (intrinsic shape: ${JSON.stringify(raw).slice(0, 80)})` : ""}.`);
16749
16806
  roleArn = raw;
16750
16807
  }
16751
- if (!roleArn && context.stackName && context.stackName === stackName && region === this.resolverRegion) throw new Error(`Fn::GetStackOutput: cannot reference own stack '${stackName}' in the same region '${region}'`);
16808
+ if (!roleArn && context.stackName && context.stackName === stackName && canonicalizeRegion(region) === canonicalizeRegion(this.resolverRegion)) throw new Error(`Fn::GetStackOutput: cannot reference own stack '${stackName}' in the same region '${region}'`);
16752
16809
  const loggedStackName = this.maskSecretsForLog(stackName, context);
16753
16810
  const loggedOutputName = this.maskSecretsForLog(outputName, context);
16754
16811
  this.logger.debug(`Resolving Fn::GetStackOutput: StackName=${loggedStackName}, Region=${region}, OutputName=${loggedOutputName}${roleArn ? `, RoleArn=${roleArn}` : ""}`);
@@ -18173,7 +18230,7 @@ var CloudControlProvider = class {
18173
18230
  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);
18174
18231
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
18175
18232
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
18176
- const { ASGProvider } = await import("./asg-provider-kMX2xn6Q.js").then((n) => n.n);
18233
+ const { ASGProvider } = await import("./asg-provider-_PwR0OUM.js").then((n) => n.n);
18177
18234
  return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
18178
18235
  }
18179
18236
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
@@ -26869,7 +26926,7 @@ const FLUSH_INTERVAL_MS = 2e3;
26869
26926
  const FLUSH_EVENT_THRESHOLD = 50;
26870
26927
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
26871
26928
  function getCdkdVersion() {
26872
- return "0.284.45";
26929
+ return "0.284.47";
26873
26930
  }
26874
26931
  /**
26875
26932
  * Generate a time-sortable unique run id, e.g.
@@ -29492,4 +29549,4 @@ var DeployEngine = class {
29492
29549
 
29493
29550
  //#endregion
29494
29551
  export { startInterruptWatch as $, setAwsClients as $n, WorkGraph as $t, renderStatefulReason as A, resolveCaptureObservedState as An, redactSecretsForState as At, exportAliasCollisionScrubWarning as B, findLargeInlineResources as Bn, DiffCalculator as Bt, isFinalSnapshotError as C, getDockerImageBySourceHash as Cn, normalizeAwsError as Cr, TEMPLATE_SOURCED_RULES as Ct, extractDeploymentEventError as D, getLegacyStateBucketName as Dn, isThrottlingError as Dr, isSingleDynamicReferenceToken as Dt, makeCanonicalizePropertiesFn as E, getDefaultStateBucketName as En, isRetryableTransientError as Er, errorCauseChain as Et, green as F, stateBucketExistenceConfirmed as Fn, s3BucketDomainName as Ft, collectInlinePolicyNamesManagedBySiblings as G, derivePartitionAndUrlSuffix as Gn, TemplateParser as Gt, secretBearingStateKeyWarning as H, expectedOwnerParam as Hn, describeTypeWithThrottleRetry as Ht, red as I, warnDeprecatedNoPrefixCliFlag as In, s3BucketDualStackDomainName as It, findActionableSilentDrops as J, clearBucketRegionCache as Jn, S3StateBackend as Jt, clearOnUpdateRemoval as K, AssemblyReader as Kn, LockManager as Kt, yellow as L, CFN_TEMPLATE_BODY_LIMIT as Ln, s3BucketRegionalDomainName as Lt, bold as M, resolveStateBucketWithDefault as Mn, classifyReplaySecretRegion as Mt, cyan as N, resolveStateBucketWithDefaultAndSource as Nn, producerRegionsFromState as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, resolveApp as On, markNonRetryable as Or, maskSecretsInError as Ot, gray as P, resolveUseCdkBootstrapAssets as Pn, s3BucketArn as Pt, isInterruptedWaitError as Q, resetAwsClients as Qn, stringifyValue as Qt, collectDeclaredOutputNames as R, CFN_TEMPLATE_URL_LIMIT as Rn, s3BucketWebsiteUrl as Rt, createPreDeleteFinalSnapshot as S, AssetManifestLoader as Sn, isCdkdError as Sr, STATE_SOURCED_READBACK_RULES as St, unsupportedFinalSnapshotError as T, synthesisStatusMessage as Tn, isMarkedNonRetryable as Tr, dynamicReferenceTokens as Tt, stateKeySecretExposure as U, PARTITION_TABLE as Un, withRetry as Ut, isExportAliasCollision as V, uploadCfnTemplate as Vn, INTRINSIC_KEYS as Vt, IAMRoleProvider as W, canonicalizeRegion as Wn, DagBuilder as Wt, beginCommandInterruptScope as X, AwsClients as Xn, shouldRetainResource as Xt, findSilentDropProperties as Y, resolveBucketRegion as Yn, rebuildClientForBucketRegion as Yt, endCommandInterruptScope as Z, getAwsClients as Zn, AssetPublisher as Zt, computeImplicitDeleteEdges as _, formatDockerLoginError as _n, StackHasActiveImportsError as _r, replayWarn as _t, DeploymentEventsStore as a, stripControlChars as an, DeployCancelledError as ar, carriesDynamicReference as at, buildFinalSnapshotIdentifier as b, runDockerForeground as bn, SynthesisError as br, requireConfigString as bt, replayFailedOperations as c, ensureAssetStorage as cn, LocalMigrateError as cr, refStateLookupFromResource as ct, updatePartialReason as d, readBootstrapMarkerBody as dn, MissingCdkCliError as dr, resolveExplicitPhysicalId as dt, buildAssetRedirectMap as en, AssetError as er, CloudControlProvider as et, UNSPECIFIED_SKIP_REASON as f, validateAssetBucketName as fn, NestedStackChildDirectDestroyError as fr, assertRegionMatch as ft, IMPLICIT_DELETE_DEPENDENCIES as g, dockerSpawnEnvWithSensitive as gn, ResourceUpdateNotSupportedError as gr, readConfigString as gt, maskingRetryLogger as h, buildDockerImage as hn, ResourceTimeoutError as hr, configStringRefusal as ht, DeploymentEventsReader as i, escapeRegExp$1 as in, DependencyError as ir, IntrinsicFunctionResolver as it, formatResourceLine as j, resolveSkipPrefix as jn, scrubResourceRecord as jt, isStatefulRecreateTargetSync as k, resolveAutoAssetStorage as kn, __exportAll as kr, maskSecretsInText as kt, replayRollback as l, getBootstrapMarkerKey as ln, LocalStartServiceError as lr, WAFv2WebACLProvider as lt, withResourceDeadline as m, buildDenyExternalAccessPolicy as mn, ProvisioningError as mr, configBooleanRefusal as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, loadPublishableAssetManifest as nn, ConfigError as nr, disableInstanceApiTermination as nt, planFailedOps as o, AssetModeResolver as on, DynamicReferenceRegionAmbiguousError as or, cfnRefValueFromPhysicalId as ot, deleteSkipReason as p, validateContainerRepoName as pn, PartialFailureError as pr, coerceCfnBoolean as pt, ProviderRegistry as q, processStackMessages as qn, displaySafe as qt, DeployEngine as r, rewriteTemplateAssetReferences as rn, CrossAccountSecretRefusalError as rr, isTerminationProtectionPropagationError as rt, planRollback as s, BOOTSTRAP_MARKER_PREFIX as sn, LocalInvokeBuildError as sr, getAccountInfo as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, createAssetRedirectResolver as tn, CdkdError as tr, slowCcOperationTimeoutMs as tt, updatePartialMessage as u, parseBootstrapMarker as un, LockError as ur, normalizeAwsTagsToCfn as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, getDockerCmd as vn, StackTerminationProtectionError as vr, requireConfigArray as vt, refusesFinalSnapshot as w, Synthesizer as wn, withErrorHandling as wr, createSecretMasker as wt, ccRoutedFinalSnapshotError as x, runDockerStreaming as xn, formatError as xr, STATE_SOURCED_CROSS_GENERATION_RULES as xt, PRE_DELETE_SNAPSHOT_TYPES as y, partitionSensitiveEnv as yn, StateError as yr, requireConfigObject as yt, collectPublishedOutputNames as z, MIGRATE_TMP_PREFIX as zn, applyRoleArnIfSet as zt };
29495
- //# sourceMappingURL=deploy-engine-BM0TxXk2.js.map
29552
+ //# sourceMappingURL=deploy-engine-yvTKD2qC.js.map