@go-to-k/cdkd 0.167.3 → 0.169.0

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.
@@ -3355,7 +3355,8 @@ const STATE_SCHEMA_VERSIONS_READABLE = [
3355
3355
  4,
3356
3356
  5,
3357
3357
  6,
3358
- 7
3358
+ 7,
3359
+ 8
3359
3360
  ];
3360
3361
  /**
3361
3362
  * Returns true when a recorded `DeletionPolicy` should prevent cdkd from
@@ -3598,7 +3599,7 @@ var S3StateBackend = class {
3598
3599
  const { expectedEtag, migrateLegacy } = options;
3599
3600
  const body = {
3600
3601
  ...state,
3601
- version: 7,
3602
+ version: 8,
3602
3603
  stackName,
3603
3604
  region
3604
3605
  };
@@ -6274,9 +6275,26 @@ var IntrinsicFunctionResolver = class {
6274
6275
  }
6275
6276
  const value = outputs[outputName];
6276
6277
  this.logger.info(`Resolved Fn::GetStackOutput: StackName=${stackName}, Region=${region}, OutputName=${outputName}${roleArn ? `, RoleArn=${roleArn}` : ""} -> ${JSON.stringify(value)}`);
6278
+ if (!roleArn) this.recordOutputRead(context, stackName, region, outputName);
6277
6279
  return value;
6278
6280
  }
6279
6281
  /**
6282
+ * Push a resolved `Fn::GetStackOutput` into the consumer's
6283
+ * recorded-output-reads bag (schema v8+, issue #668). Skips
6284
+ * duplicates within the SAME bag — multiple references to the
6285
+ * same `(sourceStack, sourceRegion, outputName)` triple emit one
6286
+ * entry. Same dedup discipline as `recordImport`.
6287
+ */
6288
+ recordOutputRead(context, producerStack, producerRegion, outputName) {
6289
+ if (!context.recordedOutputReads) return;
6290
+ if (context.recordedOutputReads.some((e) => e.sourceStack === producerStack && e.sourceRegion === producerRegion && e.outputName === outputName)) return;
6291
+ context.recordedOutputReads.push({
6292
+ sourceStack: producerStack,
6293
+ sourceRegion: producerRegion,
6294
+ outputName
6295
+ });
6296
+ }
6297
+ /**
6280
6298
  * Read the producer's state from the SAME AWS account (no RoleArn).
6281
6299
  *
6282
6300
  * Uses the consumer's shared `context.stateBackend` — the same backend
@@ -11449,6 +11467,14 @@ var DeployEngine = class {
11449
11467
  */
11450
11468
  recordedImports = [];
11451
11469
  /**
11470
+ * Per-deploy-session bag the resolver pushes resolved
11471
+ * `Fn::GetStackOutput` entries into (schema v8+, issue #668).
11472
+ * Reset at the start of each `deploy()` call and persisted to
11473
+ * `newState.outputReads` at the end. Sibling of `recordedImports`
11474
+ * for the weak-reference `Fn::GetStackOutput` intrinsic.
11475
+ */
11476
+ recordedOutputReads = [];
11477
+ /**
11452
11478
  * Target region for this stack. Required — load-bearing for the
11453
11479
  * region-prefixed S3 state key and recorded in state.json for
11454
11480
  * cross-region destroy.
@@ -11477,6 +11503,7 @@ var DeployEngine = class {
11477
11503
  */
11478
11504
  async deploy(stackName, template) {
11479
11505
  this.recordedImports = [];
11506
+ this.recordedOutputReads = [];
11480
11507
  return withStackName(stackName, () => this.doDeploy(stackName, template));
11481
11508
  }
11482
11509
  /**
@@ -11494,7 +11521,8 @@ var DeployEngine = class {
11494
11521
  stateBackend: this.stateBackend,
11495
11522
  stackName,
11496
11523
  ...this.exportIndexStore && { exportIndex: this.exportIndexStore },
11497
- recordedImports: this.recordedImports
11524
+ recordedImports: this.recordedImports,
11525
+ recordedOutputReads: this.recordedOutputReads
11498
11526
  };
11499
11527
  }
11500
11528
  /**
@@ -11632,7 +11660,7 @@ var DeployEngine = class {
11632
11660
  try {
11633
11661
  const currentStateData = await this.stateBackend.getState(stackName, this.stackRegion);
11634
11662
  const currentState = currentStateData?.state ?? {
11635
- version: 7,
11663
+ version: 8,
11636
11664
  region: this.stackRegion,
11637
11665
  stackName,
11638
11666
  resources: {},
@@ -11681,12 +11709,13 @@ var DeployEngine = class {
11681
11709
  await this.drainObservedCaptures(currentState.resources);
11682
11710
  try {
11683
11711
  const refreshedState = {
11684
- version: 7,
11712
+ version: 8,
11685
11713
  region: this.stackRegion,
11686
11714
  stackName: currentState.stackName,
11687
11715
  resources: currentState.resources,
11688
11716
  outputs: currentState.outputs,
11689
11717
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
11718
+ ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
11690
11719
  lastModified: Date.now()
11691
11720
  };
11692
11721
  const saveOptions = {};
@@ -11781,12 +11810,13 @@ var DeployEngine = class {
11781
11810
  saveChain = saveChain.then(async () => {
11782
11811
  try {
11783
11812
  const partialState = {
11784
- version: 7,
11813
+ version: 8,
11785
11814
  region: this.stackRegion,
11786
11815
  stackName: currentState.stackName,
11787
11816
  resources: newResources,
11788
11817
  outputs: currentState.outputs,
11789
11818
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
11819
+ ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
11790
11820
  lastModified: Date.now()
11791
11821
  };
11792
11822
  const migrate = pendingMigration;
@@ -11889,12 +11919,13 @@ var DeployEngine = class {
11889
11919
  } catch (error) {
11890
11920
  try {
11891
11921
  const preRollbackState = {
11892
- version: 7,
11922
+ version: 8,
11893
11923
  region: this.stackRegion,
11894
11924
  stackName: currentState.stackName,
11895
11925
  resources: newResources,
11896
11926
  outputs: currentState.outputs,
11897
11927
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
11928
+ ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
11898
11929
  lastModified: Date.now()
11899
11930
  };
11900
11931
  const migrate = pendingMigration;
@@ -11918,12 +11949,13 @@ var DeployEngine = class {
11918
11949
  } else await this.performRollback(completedOperations, newResources, stackName);
11919
11950
  try {
11920
11951
  const postRollbackState = {
11921
- version: 7,
11952
+ version: 8,
11922
11953
  region: this.stackRegion,
11923
11954
  stackName: currentState.stackName,
11924
11955
  resources: newResources,
11925
11956
  outputs: currentState.outputs,
11926
11957
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
11958
+ ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
11927
11959
  lastModified: Date.now()
11928
11960
  };
11929
11961
  await this.stateBackend.saveState(stackName, this.stackRegion, this.withParentInfo(postRollbackState), { ...currentEtag !== void 0 && { expectedEtag: currentEtag } });
@@ -11933,12 +11965,13 @@ var DeployEngine = class {
11933
11965
  try {
11934
11966
  const freshEtag = (await this.stateBackend.getState(stackName, this.stackRegion))?.etag;
11935
11967
  const postRollbackState = {
11936
- version: 7,
11968
+ version: 8,
11937
11969
  region: this.stackRegion,
11938
11970
  stackName: currentState.stackName,
11939
11971
  resources: newResources,
11940
11972
  outputs: currentState.outputs,
11941
11973
  ...currentState.imports && currentState.imports.length > 0 && { imports: currentState.imports },
11974
+ ...currentState.outputReads && currentState.outputReads.length > 0 && { outputReads: currentState.outputReads },
11942
11975
  lastModified: Date.now()
11943
11976
  };
11944
11977
  await this.stateBackend.saveState(stackName, this.stackRegion, this.withParentInfo(postRollbackState), { ...freshEtag !== void 0 && { expectedEtag: freshEtag } });
@@ -11952,12 +11985,13 @@ var DeployEngine = class {
11952
11985
  const outputs = await this.resolveOutputs(template, newResources, stackName, parameterValues, conditions);
11953
11986
  return {
11954
11987
  state: {
11955
- version: 7,
11988
+ version: 8,
11956
11989
  region: this.stackRegion,
11957
11990
  stackName: currentState.stackName,
11958
11991
  resources: newResources,
11959
11992
  outputs,
11960
11993
  ...this.recordedImports.length > 0 && { imports: [...this.recordedImports] },
11994
+ ...this.recordedOutputReads.length > 0 && { outputReads: [...this.recordedOutputReads] },
11961
11995
  lastModified: Date.now()
11962
11996
  },
11963
11997
  actualCounts
@@ -12563,4 +12597,4 @@ var DeployEngine = class {
12563
12597
 
12564
12598
  //#endregion
12565
12599
  export { AssetError as $, S3StateBackend as A, resolveCaptureObservedState as B, assertRegionMatch as C, DagBuilder as D, DiffCalculator as E, buildDockerImage as F, CFN_TEMPLATE_BODY_LIMIT as G, resolveStateBucketWithDefault as H, Synthesizer as I, findLargeInlineResources as J, CFN_TEMPLATE_URL_LIMIT as K, getDefaultStateBucketName as L, AssetPublisher as M, stringifyValue as N, TemplateParser as O, WorkGraph as P, resolveBucketRegion as Q, getLegacyStateBucketName as R, CloudControlProvider as S, applyRoleArnIfSet as T, resolveStateBucketWithDefaultAndSource as U, resolveSkipPrefix as V, warnDeprecatedNoPrefixCliFlag as W, AssemblyReader as X, uploadCfnTemplate as Y, clearBucketRegionCache as Z, matchesCdkPath as _, SynthesisError as _t, withRetry as a, LocalStartServiceError as at, ProviderRegistry as b, normalizeAwsError as bt, bold as c, NestedStackChildDirectDestroyError as ct, green as d, ResourceTimeoutError as dt, CdkdError as et, red as f, ResourceUpdateNotSupportedError as ft, CDK_PATH_TAG as g, StateError as gt, collectInlinePolicyNamesManagedBySiblings as h, StackTerminationProtectionError as ht, withResourceDeadline as i, LocalMigrateError as it, shouldRetainResource as j, LockManager as k, cyan as l, PartialFailureError as lt, IAMRoleProvider as m, StackHasActiveImportsError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, DependencyError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, LockError as ot, yellow as p, RouteDiscoveryError as pt, MIGRATE_TMP_PREFIX as q, DeployEngine as r, LocalInvokeBuildError as rt, formatResourceLine as s, MissingCdkCliError as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, ConfigError as tt, gray as u, ProvisioningError as ut, normalizeAwsTagsToCfn as v, formatError as vt, IntrinsicFunctionResolver as w, findActionableSilentDrops as x, withErrorHandling as xt, resolveExplicitPhysicalId as y, isCdkdError as yt, resolveApp as z };
12566
- //# sourceMappingURL=deploy-engine-BQkk03hJ.js.map
12600
+ //# sourceMappingURL=deploy-engine-Cux0aKqI.js.map