@go-to-k/cdkd 0.288.6 → 0.288.7

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ProviderRegistry, Br as setAwsClients, Fr as clearBucketRegionCache, Gr as DependencyError, Gt as DiffCalculator, Hr as CdkdError, Ir as resolveBucketRegion, Lr as AwsClients, Nr as AssemblyReader, Qt as TemplateParser, Rr as getAwsClients, Ur as ConfigError, Vr as AssetError, X as IAMRoleProvider, Zr as LockError, Zt as DagBuilder, ai as StateError, ci as isCdkdError, ei as ProvisioningError, gn as S3StateBackend, hn as LockManager, kn as AssetPublisher, li as normalizeAwsError, lr as Synthesizer, lt as CloudControlProvider, oi as SynthesisError, r as DeployEngine, si as formatError, zr as resetAwsClients } from "./deploy-engine-umIP3xus.js";
1
+ import { $ as ProviderRegistry, Br as setAwsClients, Fr as clearBucketRegionCache, Gr as DependencyError, Gt as DiffCalculator, Hr as CdkdError, Ir as resolveBucketRegion, Lr as AwsClients, Nr as AssemblyReader, Qt as TemplateParser, Rr as getAwsClients, Ur as ConfigError, Vr as AssetError, X as IAMRoleProvider, Zr as LockError, Zt as DagBuilder, ai as StateError, ci as isCdkdError, ei as ProvisioningError, gn as S3StateBackend, hn as LockManager, kn as AssetPublisher, li as normalizeAwsError, lr as Synthesizer, lt as CloudControlProvider, oi as SynthesisError, r as DeployEngine, si as formatError, zr as resetAwsClients } from "./deploy-engine-BQUjVO_m.js";
2
2
  import { a as setLogger, n as getLogger, t as ConsoleLogger } from "./logger-Dw-3y48G.js";
3
3
 
4
4
  export { AssemblyReader, AssetError, AssetPublisher, AwsClients, CdkdError, CloudControlProvider, ConfigError, ConsoleLogger, DagBuilder, DependencyError, DeployEngine, DiffCalculator, IAMRoleProvider, LockError, LockManager, ProviderRegistry, ProvisioningError, S3StateBackend, StateError, SynthesisError, Synthesizer, TemplateParser, clearBucketRegionCache, formatError, getAwsClients, getLogger, isCdkdError, normalizeAwsError, resetAwsClients, resolveBucketRegion, setAwsClients, setLogger };
@@ -1,8 +1,8 @@
1
- import { $ as ProviderRegistry, $n as formatDockerLoginError, $r as PartialFailureError, $t as STATE_SOURCED_BASELINE_RULES, A as renderStatefulReason, An as stringifyValue, Ar as PARTITION_TABLE, At as configStringRefusal, B as red, Bn as getBootstrapMarkerKey, Br as setAwsClients, Bt as s3BucketDomainName, C as refusesFinalSnapshot, Cn as CUSTOM_RESOURCE_RESPONSE_PREFIX, Cr as CFN_TEMPLATE_URL_LIMIT, Ct as refStateLookupFromResource, D as MULTI_REGION_RECREATE_BLOCKED_TYPES, Dn as importableOutputs, Dr as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Dt as assertRegionMatch, E as extractDeploymentEventError, En as importableOutputKeys, Er as uploadCfnTemplate, Et as resolveExplicitPhysicalId, F as formatResourceLine, Fn as rewriteTemplateAssetReferences, Ft as requireConfigString, G as isExportAliasCollision, Gn as validateContainerRepoName, Gt as DiffCalculator, H as collectDeclaredOutputNames, Hn as parseBootstrapMarker, Hr as CdkdError, Ht as s3BucketRegionalDomainName, I as bold, In as AssetModeResolver, Ir as resolveBucketRegion, It as classifyReplaySecretRegion, J as secretSafeKeyDisplay, Jn as buildDockerImage, Jr as IntrinsicResolutionRefusalError, Jt as findSilentDropProperties, K as secretBearing, Kn as buildDenyExternalAccessPolicy, Kr as DeployCancelledError, Kt as INTRINSIC_KEYS, L as cyan, Ln as BOOTSTRAP_MARKER_PREFIX, Lr as AwsClients, Lt as producerRegionsFromState, M as coerceWarmThroughput$1, Mn as buildAssetRedirectMap, Mr as derivePartitionAndUrlSuffix, Mt as replayWarn, N as isWarmThroughputDecrease, Nn as createAssetRedirectResolver, Nr as AssemblyReader, Nt as requireConfigArray, O as isStatefulRecreateTargetForReplace, On as shouldRetainResource, Or as displaySafe, Ot as coerceCfnBoolean, P as toFiniteNumber, Pn as loadPublishableAssetManifest, Pr as processStackMessages, Pt as requireConfigObject, Q as clearOnUpdateRemoval, Qn as dockerSpawnEnvWithSensitive, Qr as NestedStackChildDirectDestroyError, Qt as TemplateParser, R as gray, Rn as assertAssetBucketRegion, Rr as getAwsClients, Rt as withSharedDrainBudget, S as isFinalSnapshotError, Sn as shellQuote, Sr as CFN_TEMPLATE_BODY_LIMIT, St as parameterTypeMayLoseSecretIdentity, T as makeCanonicalizePropertiesFn, Tn as exportNamesCarriedFrom, Tr as findLargeInlineResources, Tt as normalizeAwsTagsToCfn, U as collectPublishedOutputNames, Un as readBootstrapMarkerBody, Ut as s3BucketWebsiteUrl, V as yellow, Vn as isCrossRegionRedirect, Vt as s3BucketDualStackDomainName, W as exportAliasCollisionScrubWarning, Wn as validateAssetBucketName, Wr as CrossAccountSecretRefusalError, Wt as applyRoleArnIfSet, X as IAMRoleProvider, Xn as describeDockerExecFailure, Xr as LocalStartServiceError, Xt as withRetry, Y as getCurrentResourceSecrets, Yn as describeDockerCapturedOutput, Yr as LocalInvokeBuildError$1, Yt as describeTypeWithThrottleRetry, Z as collectInlinePolicyNamesManagedBySiblings, Zn as describeDockerFailure, Zt as DagBuilder, _ as ATOMIC_FINAL_SNAPSHOT_TYPES, _i as retryClassificationText, _n as rebuildClientForBucketRegion, _r as resolveStateBucketWithDefault, _t as carriesDynamicReference, a as DeploymentEventsStore, an as dynamicReferenceTokens, ar as escapeRegExp, at as endCommandInterruptScope, b as ccRoutedFinalSnapshotError, bn as buildLockContentionMessage, br as stateBucketExistenceConfirmed, bt as getAccountInfo, c as replayFailedOperations, cn as isSingleDynamicReferenceToken, cr as getDockerImageBySourceHash, ct as startInterruptWatch, d as updatePartialReason, di as isMarkedNonRetryable, dn as recordMaskOnlyValue, dr as getDefaultStateBucketName, dt as UNSPECIFIED_SKIP_REASON, ei as ProvisioningError, en as STATE_SOURCED_CROSS_GENERATION_RULES, er as getDockerCmd, et as wouldReturnToSdkProvider, f as withResourceDeadline, fi as isRetryableTransientError, fn as recoverMaskedOutput, fr as getLegacyStateBucketName, ft as deleteIndeterminateGuards, g as bindingSkippedOutputs, gi as markRedactedCause, gn as S3StateBackend, gr as resolveSkipPrefix, gt as IntrinsicFunctionResolver, h as computeImplicitDeleteEdges, hi as markNonRetryable, hn as LockManager, hr as resolveCaptureObservedState, ht as isTerminationProtectionPropagationError, i as DeploymentEventsReader, ii as StackTerminationProtectionError, in as createSecretMasker, ir as runDockerStreaming, it as beginCommandInterruptScope, j as WARM_THROUGHPUT_MEMBERS, jn as WorkGraph, jr as canonicalizeRegion, jt as readConfigString, k as isStatefulRecreateTargetSync, kn as AssetPublisher, kr as expectedOwnerParam, kt as configBooleanRefusal, l as replayRollback, li as normalizeAwsError, ln as maskSecretsInError, lr as Synthesizer, lt as CloudControlProvider, m as IMPLICIT_DELETE_DEPENDENCIES, mi as isTransientServerError, mn as scrubResourceRecord, mr as resolveAutoAssetStorage, mt as disableInstanceApiTermination, n as DEFAULT_RESOURCE_WARN_AFTER_MS, ni as ResourceUpdateNotSupportedError, nn as TEMPLATE_SOURCED_RULES, nr as redactDockerArgvValues, nt as maskDeep, o as planFailedOps, on as errorCauseChain, or as stripControlChars, ot as interruptWatchListenerCount, p as maskingRetryLogger, pi as isThrottlingError, pn as redactSecretsForState, pr as resolveApp, pt as deleteSkipReason, q as secretBearingStateKeyWarning, qn as describeAwsFailure, qr as DynamicReferenceRegionAmbiguousError, qt as findActionableSilentDrops, r as DeployEngine, ri as StackHasActiveImportsError, rn as carriesSecretMask, rr as runDockerForeground, rt as maskerOrIdentity, s as planRollback, sn as identityKeyFor, sr as AssetManifestLoader, st as isInterruptedWaitError, t as DEFAULT_RESOURCE_TIMEOUT_MS, ti as ResourceTimeoutError, tn as STATE_SOURCED_READBACK_RULES, tr as partitionSensitiveEnv, tt as createMaskedRetryLogger, u as updatePartialMessage, ui as withErrorHandling, un as maskSecretsInText, ur as synthesisStatusMessage, ut as slowCcOperationTimeoutMs, v as PRE_DELETE_SNAPSHOT_TYPES, vn as UNRENDERABLE, vr as resolveStateBucketWithDefaultAndSource, vt as cfnRefValueFromPhysicalId, w as unsupportedFinalSnapshotError, wn as DEFAULT_STATE_PREFIX, wr as MIGRATE_TMP_PREFIX, wt as WAFv2WebACLProvider, x as createPreDeleteFinalSnapshot, xn as forceQuitRecoveryClause, xr as warnDeprecatedNoPrefixCliFlag, xt as isUnboundTemplateParameter, y as buildFinalSnapshotIdentifier, yn as buildForceUnlockCommand, yr as resolveUseCdkBootstrapAssets, yt as coerceParameterTypedValue, z as green, zn as ensureAssetStorage, zr as resetAwsClients, zt as s3BucketArn } from "./deploy-engine-umIP3xus.js";
1
+ import { $ as ProviderRegistry, $n as formatDockerLoginError, $r as PartialFailureError, $t as STATE_SOURCED_BASELINE_RULES, A as renderStatefulReason, An as stringifyValue, Ar as PARTITION_TABLE, At as configStringRefusal, B as red, Bn as getBootstrapMarkerKey, Br as setAwsClients, Bt as s3BucketDomainName, C as refusesFinalSnapshot, Cn as CUSTOM_RESOURCE_RESPONSE_PREFIX, Cr as CFN_TEMPLATE_URL_LIMIT, Ct as refStateLookupFromResource, D as MULTI_REGION_RECREATE_BLOCKED_TYPES, Dn as importableOutputs, Dr as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Dt as assertRegionMatch, E as extractDeploymentEventError, En as importableOutputKeys, Er as uploadCfnTemplate, Et as resolveExplicitPhysicalId, F as formatResourceLine, Fn as rewriteTemplateAssetReferences, Ft as requireConfigString, G as isExportAliasCollision, Gn as validateContainerRepoName, Gt as DiffCalculator, H as collectDeclaredOutputNames, Hn as parseBootstrapMarker, Hr as CdkdError, Ht as s3BucketRegionalDomainName, I as bold, In as AssetModeResolver, Ir as resolveBucketRegion, It as classifyReplaySecretRegion, J as secretSafeKeyDisplay, Jn as buildDockerImage, Jr as IntrinsicResolutionRefusalError, Jt as findSilentDropProperties, K as secretBearing, Kn as buildDenyExternalAccessPolicy, Kr as DeployCancelledError, Kt as INTRINSIC_KEYS, L as cyan, Ln as BOOTSTRAP_MARKER_PREFIX, Lr as AwsClients, Lt as producerRegionsFromState, M as coerceWarmThroughput$1, Mn as buildAssetRedirectMap, Mr as derivePartitionAndUrlSuffix, Mt as replayWarn, N as isWarmThroughputDecrease, Nn as createAssetRedirectResolver, Nr as AssemblyReader, Nt as requireConfigArray, O as isStatefulRecreateTargetForReplace, On as shouldRetainResource, Or as displaySafe, Ot as coerceCfnBoolean, P as toFiniteNumber, Pn as loadPublishableAssetManifest, Pr as processStackMessages, Pt as requireConfigObject, Q as clearOnUpdateRemoval, Qn as dockerSpawnEnvWithSensitive, Qr as NestedStackChildDirectDestroyError, Qt as TemplateParser, R as gray, Rn as assertAssetBucketRegion, Rr as getAwsClients, Rt as withSharedDrainBudget, S as isFinalSnapshotError, Sn as shellQuote, Sr as CFN_TEMPLATE_BODY_LIMIT, St as parameterTypeMayLoseSecretIdentity, T as makeCanonicalizePropertiesFn, Tn as exportNamesCarriedFrom, Tr as findLargeInlineResources, Tt as normalizeAwsTagsToCfn, U as collectPublishedOutputNames, Un as readBootstrapMarkerBody, Ut as s3BucketWebsiteUrl, V as yellow, Vn as isCrossRegionRedirect, Vt as s3BucketDualStackDomainName, W as exportAliasCollisionScrubWarning, Wn as validateAssetBucketName, Wr as CrossAccountSecretRefusalError, Wt as applyRoleArnIfSet, X as IAMRoleProvider, Xn as describeDockerExecFailure, Xr as LocalStartServiceError, Xt as withRetry, Y as getCurrentResourceSecrets, Yn as describeDockerCapturedOutput, Yr as LocalInvokeBuildError$1, Yt as describeTypeWithThrottleRetry, Z as collectInlinePolicyNamesManagedBySiblings, Zn as describeDockerFailure, Zt as DagBuilder, _ as ATOMIC_FINAL_SNAPSHOT_TYPES, _i as retryClassificationText, _n as rebuildClientForBucketRegion, _r as resolveStateBucketWithDefault, _t as carriesDynamicReference, a as DeploymentEventsStore, an as dynamicReferenceTokens, ar as escapeRegExp, at as endCommandInterruptScope, b as ccRoutedFinalSnapshotError, bn as buildLockContentionMessage, br as stateBucketExistenceConfirmed, bt as getAccountInfo, c as replayFailedOperations, cn as isSingleDynamicReferenceToken, cr as getDockerImageBySourceHash, ct as startInterruptWatch, d as updatePartialReason, di as isMarkedNonRetryable, dn as recordMaskOnlyValue, dr as getDefaultStateBucketName, dt as UNSPECIFIED_SKIP_REASON, ei as ProvisioningError, en as STATE_SOURCED_CROSS_GENERATION_RULES, er as getDockerCmd, et as wouldReturnToSdkProvider, f as withResourceDeadline, fi as isRetryableTransientError, fn as recoverMaskedOutput, fr as getLegacyStateBucketName, ft as deleteIndeterminateGuards, g as bindingSkippedOutputs, gi as markRedactedCause, gn as S3StateBackend, gr as resolveSkipPrefix, gt as IntrinsicFunctionResolver, h as computeImplicitDeleteEdges, hi as markNonRetryable, hn as LockManager, hr as resolveCaptureObservedState, ht as isTerminationProtectionPropagationError, i as DeploymentEventsReader, ii as StackTerminationProtectionError, in as createSecretMasker, ir as runDockerStreaming, it as beginCommandInterruptScope, j as WARM_THROUGHPUT_MEMBERS, jn as WorkGraph, jr as canonicalizeRegion, jt as readConfigString, k as isStatefulRecreateTargetSync, kn as AssetPublisher, kr as expectedOwnerParam, kt as configBooleanRefusal, l as replayRollback, li as normalizeAwsError, ln as maskSecretsInError, lr as Synthesizer, lt as CloudControlProvider, m as IMPLICIT_DELETE_DEPENDENCIES, mi as isTransientServerError, mn as scrubResourceRecord, mr as resolveAutoAssetStorage, mt as disableInstanceApiTermination, n as DEFAULT_RESOURCE_WARN_AFTER_MS, ni as ResourceUpdateNotSupportedError, nn as TEMPLATE_SOURCED_RULES, nr as redactDockerArgvValues, nt as maskDeep, o as planFailedOps, on as errorCauseChain, or as stripControlChars, ot as interruptWatchListenerCount, p as maskingRetryLogger, pi as isThrottlingError, pn as redactSecretsForState, pr as resolveApp, pt as deleteSkipReason, q as secretBearingStateKeyWarning, qn as describeAwsFailure, qr as DynamicReferenceRegionAmbiguousError, qt as findActionableSilentDrops, r as DeployEngine, ri as StackHasActiveImportsError, rn as carriesSecretMask, rr as runDockerForeground, rt as maskerOrIdentity, s as planRollback, sn as identityKeyFor, sr as AssetManifestLoader, st as isInterruptedWaitError, t as DEFAULT_RESOURCE_TIMEOUT_MS, ti as ResourceTimeoutError, tn as STATE_SOURCED_READBACK_RULES, tr as partitionSensitiveEnv, tt as createMaskedRetryLogger, u as updatePartialMessage, ui as withErrorHandling, un as maskSecretsInText, ur as synthesisStatusMessage, ut as slowCcOperationTimeoutMs, v as PRE_DELETE_SNAPSHOT_TYPES, vn as UNRENDERABLE, vr as resolveStateBucketWithDefaultAndSource, vt as cfnRefValueFromPhysicalId, w as unsupportedFinalSnapshotError, wn as DEFAULT_STATE_PREFIX, wr as MIGRATE_TMP_PREFIX, wt as WAFv2WebACLProvider, x as createPreDeleteFinalSnapshot, xn as forceQuitRecoveryClause, xr as warnDeprecatedNoPrefixCliFlag, xt as isUnboundTemplateParameter, y as buildFinalSnapshotIdentifier, yn as buildForceUnlockCommand, yr as resolveUseCdkBootstrapAssets, yt as coerceParameterTypedValue, z as green, zn as ensureAssetStorage, zr as resetAwsClients, zt as s3BucketArn } from "./deploy-engine-BQUjVO_m.js";
2
2
  import { _ as withStackName, c as PATTERN_B_NAME_OPTIONS, f as generateResourceName, g as withSkipPrefix, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as getCurrentStackName, n as getLogger, o as runStackBuffered, p as generateResourceNameWithFallback, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES } from "./logger-Dw-3y48G.js";
3
3
  import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
4
- import { t as getCdkdVersion } from "./version-4xTzOaA1.js";
5
- import { r as protectedReplacementAdvice, t as ASGProvider } from "./asg-provider-CC6BMuNK.js";
4
+ import { t as getCdkdVersion } from "./version-DPtrXz0m.js";
5
+ import { r as protectedReplacementAdvice, t as ASGProvider } from "./asg-provider-CRxRmEzr.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { createHash, randomBytes, randomUUID } from "node:crypto";
8
8
  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, NotFound, 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";
@@ -81236,7 +81236,7 @@ function defaultOnlyParameterTemplate(template) {
81236
81236
  * the clear.
81237
81237
  *
81238
81238
  * The predicate is deliberately CONSERVATIVE — it over-refuses — and that is a
81239
- * decision a review round paid for. Two arms:
81239
+ * decision a review round paid for. Three arms:
81240
81240
  *
81241
81241
  * - **Resolution THREW** — refuse, unconditionally. A throw means the
81242
81242
  * resolver could not finish, so nothing about the persisted bag is
@@ -81264,6 +81264,19 @@ function defaultOnlyParameterTemplate(template) {
81264
81264
  * remedy -- because a populated map makes absence from it real evidence of
81265
81265
  * a public parameter, exactly as the deploy path already relies on.
81266
81266
  *
81267
+ * - **Resolution SUCCEEDED but DISCARDED a subtree that is not provably
81268
+ * inert** (issue [#2850](https://github.com/go-to-k/cdkd/issues/2850)).
81269
+ * The count in arm 2 sees only what the raw bag SPELLS, and that issue
81270
+ * measured two ways past it: a downgraded `Fn::If` dropping one reference
81271
+ * while a parameter-sourced reference is ADDED elsewhere (the totals
81272
+ * balance), and a reference sourced ENTIRELY from a parameter `Default` or
81273
+ * a `Mappings` entry then dropped (both counts read zero, and nothing
81274
+ * warns). {@link resolveDiscardsNonInertSubtree} carries the discard-event
81275
+ * enumeration and the fail-closed rules; "inert" is
81276
+ * {@link isInertDiscardedSubtree}'s definition — pure literals with no
81277
+ * opener text and no intrinsic anywhere, because every way a discarded
81278
+ * subtree could have SOURCED a reference is an intrinsic.
81279
+ *
81267
81280
  * The cost of a false refusal is one resource's drift baseline until its next
81268
81281
  * deploy; the cost of a false pass is a plaintext secret in `state.json`. So an
81269
81282
  * unmeasurable bag refuses too.
@@ -81277,9 +81290,6 @@ function defaultOnlyParameterTemplate(template) {
81277
81290
  * PLAINTEXT CAN STILL BE PERSISTED by this capture. Known ways, each with its
81278
81291
  * issue and none of them proven to be all of them:
81279
81292
  *
81280
- * - the resolve drops a reference, or trades one away, in a manner the opener
81281
- * comparison below cannot see --
81282
- * [#2850](https://github.com/go-to-k/cdkd/issues/2850);
81283
81293
  * - a parameter binds to a placeholder `Default` while the DEPLOYED value was
81284
81294
  * the reference, so no opener exists in any template this walk is handed --
81285
81295
  * [#2854](https://github.com/go-to-k/cdkd/issues/2854);
@@ -81371,7 +81381,14 @@ async function resolveImportedProperties(stackState, template, region, stateBack
81371
81381
  }
81372
81382
  const rawOpeners = countDynamicReferenceOpeners(unresolvedProperties);
81373
81383
  const persistedOpeners = countDynamicReferenceOpeners(resource.properties);
81374
- if (rawOpeners === void 0 || persistedOpeners === void 0 || persistedOpeners < rawOpeners) unsafeObservedBaselineLogicalIds.add(logicalId);
81384
+ let discardsNonInertSubtree;
81385
+ try {
81386
+ discardsNonInertSubtree = resolveDiscardsNonInertSubtree(unresolvedProperties, conditions, template.Mappings);
81387
+ } catch (err) {
81388
+ logger.debug(`observed-baseline discard walk failed for imported ${logicalId} (${resource.resourceType}): ${err instanceof Error ? err.name : typeof err} — refusing the baseline fail-closed.`);
81389
+ discardsNonInertSubtree = true;
81390
+ }
81391
+ if (rawOpeners === void 0 || persistedOpeners === void 0 || persistedOpeners < rawOpeners || discardsNonInertSubtree) unsafeObservedBaselineLogicalIds.add(logicalId);
81375
81392
  }
81376
81393
  return unsafeObservedBaselineLogicalIds;
81377
81394
  }
@@ -81405,6 +81422,199 @@ function countDynamicReferenceOpeners(bag) {
81405
81422
  from = at + 10;
81406
81423
  }
81407
81424
  }
81425
+ /**
81426
+ * Whether an object key can make the resolver treat its object as an
81427
+ * INTRINSIC. Deliberately BROADER than the resolver's own dispatch list
81428
+ * (`resolveValue` names specific keys; this matches any `Fn::`-prefixed one):
81429
+ * the callers below use it to decide what a DISCARDED subtree could have
81430
+ * been, and over-matching there only widens a refusal, never a pass.
81431
+ */
81432
+ function isIntrinsicShapedKey(key) {
81433
+ return key === "Ref" || key.startsWith("Fn::");
81434
+ }
81435
+ /**
81436
+ * Whether a subtree the resolve DISCARDED is provably INERT: pure JSON
81437
+ * literals, carrying no `{{resolve:` opener text in any string leaf and no
81438
+ * intrinsic-shaped object key anywhere.
81439
+ *
81440
+ * This is the capability question of issue
81441
+ * [#2850](https://github.com/go-to-k/cdkd/issues/2850) asked in the
81442
+ * fail-closed direction. Asking "could this subtree have carried or SOURCED a
81443
+ * dynamic reference" precisely would need enumerating every source a reference
81444
+ * can arrive from — a parameter `Default` via `Ref` or `Fn::Sub`, a `Mappings`
81445
+ * entry via `Fn::FindInMap`, another stack's outputs via `Fn::ImportValue` /
81446
+ * `Fn::GetStackOutput` — and the enumeration missing one form is exactly how
81447
+ * the opener COUNT missed the first two. Every one of those source forms is an
81448
+ * intrinsic, so "no intrinsic at all" covers them all without naming any, and
81449
+ * a plain-literal subtree is one whose value at deploy time was the same
81450
+ * public template text this walk can read.
81451
+ */
81452
+ function isInertDiscardedSubtree(node) {
81453
+ if (typeof node === "string") return !node.includes(DYNAMIC_REFERENCE_OPENER);
81454
+ if (node === null || typeof node !== "object") return true;
81455
+ if (Array.isArray(node)) return node.every((element) => isInertDiscardedSubtree(element));
81456
+ const record = node;
81457
+ const keys = Object.keys(record);
81458
+ if (keys.length === 1 && keys[0] === "Ref" && record["Ref"] === "AWS::NoValue") return true;
81459
+ return Object.entries(record).every(([key, value]) => !isIntrinsicShapedKey(key) && isInertDiscardedSubtree(value));
81460
+ }
81461
+ /**
81462
+ * Whether a scalar the resolver consumes RAW (an `Fn::Select` index) is a
81463
+ * template-constant literal that `resolveSelect`'s `resolvedList[index]` read
81464
+ * actually honors: a number, or the CANONICAL digit-string of one. The
81465
+ * canonical form is load-bearing, not pedantry — a delta review round
81466
+ * measured `['a','b']['01']` as `undefined` (a non-canonical string is a
81467
+ * property name, not an index) while CloudFormation integer-parses it to 1,
81468
+ * so `'01'` is exactly as selection-divergent as an intrinsic index and must
81469
+ * not count as static. Anything non-static makes the selection depend on a
81470
+ * value this import cannot reproduce.
81471
+ */
81472
+ function isStaticSelectIndex(value) {
81473
+ if (typeof value === "number") return Number.isInteger(value) && value >= 0;
81474
+ return typeof value === "string" && /^(0|[1-9]\d*)$/.test(value);
81475
+ }
81476
+ /**
81477
+ * A `Fn::FindInMap` lookup-key argument the resolver can only have resolved
81478
+ * to the same key at deploy time: a plain scalar literal CARRYING NO
81479
+ * `{{resolve:` opener. The opener clause is the same delta-review finding one
81480
+ * helper up: `resolveFindInMap` resolves each key through `resolveValue`, so
81481
+ * a dynamic-reference STRING key is decrypted before the lookup and the
81482
+ * selected entry depends on the secret's deploy-time value — not on the
81483
+ * template text this walk reads.
81484
+ */
81485
+ function isStaticLookupKey(value) {
81486
+ if (typeof value === "string") return !value.includes(DYNAMIC_REFERENCE_OPENER);
81487
+ return typeof value === "number" || typeof value === "boolean";
81488
+ }
81489
+ /**
81490
+ * ARM 3 of the observed-baseline refusal (issue
81491
+ * [#2850](https://github.com/go-to-k/cdkd/issues/2850)): did the resolve
81492
+ * DISCARD a subtree it cannot vouch is inert?
81493
+ *
81494
+ * The opener-count comparison (ARM 2) sees only what the raw bag SPELLS, and
81495
+ * the issue measured two ways past it on the success arm: a downgraded
81496
+ * `Fn::If` that drops one reference while a parameter-sourced reference is
81497
+ * added elsewhere (the totals balance), and a reference sourced ENTIRELY from
81498
+ * outside the bag then dropped (both counts read zero, nothing throws, no
81499
+ * warn fires). Both are DISCARD events: the resolver threw a subtree away
81500
+ * unresolved, and whatever that subtree would have produced — which is what
81501
+ * AWS actually holds when the deployed condition took the other branch — is
81502
+ * exactly what the persisted bag cannot position a redaction for.
81503
+ *
81504
+ * So this walk detects the discard EVENTS on the RAW bag instead of comparing
81505
+ * positions across the resolve (which would need a path identity across the
81506
+ * `Fn::If` collapse that does not exist). The discarders, enumerated from
81507
+ * `IntrinsicFunctionResolver` rather than assumed — and re-enumerated by this
81508
+ * PR's review round, which found the first cut had missed TWO (`Fn::FindInMap`
81509
+ * and `Fn::Select` below; an earlier revision called `resolveIf` "the only
81510
+ * LAZY selector" and the resolver's own source refutes it):
81511
+ *
81512
+ * - `resolveIf` — a LAZY selector: it resolves the selected branch
81513
+ * only, so the unselected branch is discarded UNRESOLVED. A missing
81514
+ * condition warns and selects the FALSE branch (no throw), so the success
81515
+ * arm reaches it. Dispatch is `'Fn::If' in obj`, not single-key.
81516
+ * - `resolveFindInMap` — the OTHER lazy site: the 4-argument form's
81517
+ * `DefaultValue` is resolved only on a lookup MISS, so a HIT discards it
81518
+ * unresolved; and a non-literal lookup KEY makes the un-taken mapping
81519
+ * entries discarded template content. The walk's own arm comment carries
81520
+ * both modes.
81521
+ * - `resolveSelect` — eager on the LIST but the INDEX is consumed RAW, never
81522
+ * resolved: an intrinsic index selects `undefined` here while
81523
+ * CloudFormation resolved it at deploy, so the whole list is potentially
81524
+ * discarded content. (With a NUMERIC-LITERAL index the selection is
81525
+ * template-constant and the un-selected elements were discarded at deploy
81526
+ * too — that case discards nothing AWS could hold.)
81527
+ * - Dispatch order itself — `resolveValue` dispatches on the first matching
81528
+ * intrinsic key, so an object holding an intrinsic key AMONG OTHER KEYS
81529
+ * resolves as that intrinsic and silently DROPS the sibling keys'
81530
+ * subtrees.
81531
+ * - NOT `Fn::Sub`: its variable map is resolved eagerly, every entry.
81532
+ * - NOT `Fn::Join`'s delimiter: it is consumed raw too, but CloudFormation
81533
+ * itself admits no intrinsic there, and an intrinsic delimiter joins as
81534
+ * `[object Object]` — a mangled value, not a discarded reference.
81535
+ *
81536
+ * Fail-closed rules, in the order tested (an earlier revision of this list
81537
+ * omitted the two arms the review round added while still claiming to BE the
81538
+ * tested order — a list that claims an order and is not the order is worse
81539
+ * than no list, so keep it complete or delete the claim):
81540
+ *
81541
+ * - an ARRAY recurses element-wise, so a discarder inside a list property
81542
+ * (`SecurityGroupIds: [{Fn::If: ...}]`) is found;
81543
+ * - single-key `Fn::If` with well-formed args and a condition the evaluated
81544
+ * map carries (`Object.hasOwn`, the same test `resolveIf` uses since issue
81545
+ * #2767): the UNSELECTED branch must be inert, and the SELECTED branch is
81546
+ * recursed into;
81547
+ * - single-key `Fn::If` whose condition the map does NOT carry: BOTH
81548
+ * branches must be inert. The resolver warns and takes the false branch,
81549
+ * so this is a SUPERSET of mirroring it — mirroring the lookup exactly is
81550
+ * the two-spellings-of-one-question drift this repo keeps paying for, and
81551
+ * the superset can only over-refuse, never leak;
81552
+ * - single-key `Fn::If` with MALFORMED args: refuse;
81553
+ * - single-key `Fn::FindInMap`: MALFORMED (< 3 args) refuses; a 4th
81554
+ * argument must be inert AS A WHOLE (its `DefaultValue` is resolved only
81555
+ * on a lookup miss, and any sibling key there — or a whole 4th arg with
81556
+ * no `DefaultValue` key — is discarded unconditionally); a non-literal
81557
+ * lookup key refuses unless the map in scope is inert (the NAMED map for
81558
+ * a literal map name, the whole `Mappings` section otherwise); then the
81559
+ * args recurse;
81560
+ * - single-key `Fn::Select`: MALFORMED (not exactly 2 args) refuses; a
81561
+ * non-static index refuses unless the list argument is inert; then the
81562
+ * args recurse;
81563
+ * - a MULTI-KEY object carrying intrinsic-shaped keys: TWO or more such
81564
+ * keys refuse outright (dispatch drops the losers as whole INTRINSICS,
81565
+ * whose values' text is not evidence of what they pull); with exactly
81566
+ * one, every value must be inert — which sibling the dispatch order
81567
+ * drops is deliberately not mirrored here;
81568
+ * - everything else recurses, so a nested `Fn::If` inside an `Fn::Join` /
81569
+ * `Fn::Sub` argument is still found.
81570
+ *
81571
+ * Additive beside ARM 1 (throw) and ARM 2 (count loss): refusal strictly
81572
+ * widens, so no previously-refused shape can start leaking, and the risk
81573
+ * direction is over-refusal alone. The negative controls live in the matrix:
81574
+ * an `Fn::If` discarding pure literals stays ADMITTED, and so does a
81575
+ * multi-key intrinsic object whose sibling values are literals.
81576
+ *
81577
+ * THE CALLER WRAPS EVERY CALL IN A FAIL-CLOSED try (see the ARM 3 note at
81578
+ * the call site): this walk recurses synchronously and a deep-enough bag
81579
+ * overflows the call stack where the JSON.stringify arms still compute.
81580
+ */
81581
+ function resolveDiscardsNonInertSubtree(node, conditions, mappings) {
81582
+ if (node === null || typeof node !== "object") return false;
81583
+ if (Array.isArray(node)) return node.some((element) => resolveDiscardsNonInertSubtree(element, conditions, mappings));
81584
+ const record = node;
81585
+ const keys = Object.keys(record);
81586
+ if (keys.length === 1 && keys[0] === "Fn::If") {
81587
+ const args = record["Fn::If"];
81588
+ if (!Array.isArray(args) || args.length !== 3 || typeof args[0] !== "string") return true;
81589
+ const [conditionName, valueIfTrue, valueIfFalse] = args;
81590
+ if (!Object.hasOwn(conditions, conditionName)) return !isInertDiscardedSubtree(valueIfTrue) || !isInertDiscardedSubtree(valueIfFalse);
81591
+ const selected = conditions[conditionName] ? valueIfTrue : valueIfFalse;
81592
+ if (!isInertDiscardedSubtree(conditions[conditionName] ? valueIfFalse : valueIfTrue)) return true;
81593
+ return resolveDiscardsNonInertSubtree(selected, conditions, mappings);
81594
+ }
81595
+ if (keys.length === 1 && keys[0] === "Fn::FindInMap") {
81596
+ const args = record["Fn::FindInMap"];
81597
+ if (!Array.isArray(args) || args.length < 3 || args.length > 4) return true;
81598
+ if (args.length > 3) {
81599
+ if (!isInertDiscardedSubtree(args[3])) return true;
81600
+ }
81601
+ if (!args.slice(0, 3).every((key) => isStaticLookupKey(key))) {
81602
+ if (!isInertDiscardedSubtree(typeof args[0] === "string" && mappings !== null && typeof mappings === "object" && Object.hasOwn(mappings, args[0]) ? mappings[args[0]] : mappings)) return true;
81603
+ }
81604
+ return args.some((arg) => resolveDiscardsNonInertSubtree(arg, conditions, mappings));
81605
+ }
81606
+ if (keys.length === 1 && keys[0] === "Fn::Select") {
81607
+ const args = record["Fn::Select"];
81608
+ if (!Array.isArray(args) || args.length !== 2) return true;
81609
+ if (!(isStaticSelectIndex(args[0]) && (!Array.isArray(args[1]) || Number(args[0]) < args[1].length)) && !isInertDiscardedSubtree(args[1])) return true;
81610
+ return args.some((arg) => resolveDiscardsNonInertSubtree(arg, conditions, mappings));
81611
+ }
81612
+ if (keys.length > 1 && keys.some((key) => isIntrinsicShapedKey(key))) {
81613
+ if (keys.filter((key) => isIntrinsicShapedKey(key)).length > 1) return true;
81614
+ return !keys.every((key) => isInertDiscardedSubtree(record[key]));
81615
+ }
81616
+ return keys.some((key) => resolveDiscardsNonInertSubtree(record[key], conditions, mappings));
81617
+ }
81408
81618
  function printSummary(rows) {
81409
81619
  const logger = getLogger();
81410
81620
  const counts = {
@@ -90949,4 +91159,4 @@ function buildProgram() {
90949
91159
 
90950
91160
  //#endregion
90951
91161
  export { buildProgram };
90952
- //# sourceMappingURL=program-CxMjCbiG.js.map
91162
+ //# sourceMappingURL=program-BEvh5nqs.js.map