@go-to-k/cdkd 0.221.3 → 0.221.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
2
  import { A as withErrorHandling, B as generateResourceNameWithFallback, C as StackHasActiveImportsError, F as getLiveRenderer, H as withStackName, I as PATTERN_B_NAME_PROPERTIES, L as PATTERN_B_RESOURCE_TYPES, M as getLogger, P as runStackBuffered, S as ResourceUpdateNotSupportedError, V as withSkipPrefix, _ as MissingCdkCliError, a as assertRegionMatch, b as ProvisioningError, f as LocalInvokeBuildError$1, i as resolveExplicitPhysicalId, k as normalizeAwsError, l as CdkdError, m as LocalStartServiceError, n as matchesCdkPath, o as disableInstanceApiTermination, p as LocalMigrateError, r as normalizeAwsTagsToCfn, s as isTerminationProtectionPropagationError, t as CDK_PATH_TAG, v as NestedStackChildDirectDestroyError, w as StackTerminationProtectionError, x as ResourceTimeoutError, y as PartialFailureError, z as generateResourceName } from "./import-helpers-wLipXr5g.js";
3
3
  import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-pjPwZz1r.js";
4
- import { A as AssetPublisher, B as getLegacyStateBucketName, C as DiffCalculator, D as S3StateBackend, E as LockManager, F as getDockerCmd, G as resolveStateBucketWithDefaultAndSource, H as resolveCaptureObservedState, I as runDockerForeground, J as CFN_TEMPLATE_URL_LIMIT, K as warnDeprecatedNoPrefixCliFlag, L as runDockerStreaming, M as WorkGraph, N as buildDockerImage, O as rebuildClientForBucketRegion, P as formatDockerLoginError, Q as AssemblyReader, R as Synthesizer, S as applyRoleArnIfSet, T as TemplateParser, U as resolveSkipPrefix, V as resolveApp, W as resolveStateBucketWithDefault, X as findLargeInlineResources, Y as MIGRATE_TMP_PREFIX, Z as uploadCfnTemplate, _ as collectInlinePolicyNamesManagedBySiblings, a as withRetry, b as CloudControlProvider, c as extractDeploymentEventError, d as cyan, et as resolveBucketRegion, f as gray, g as IAMRoleProvider, h as yellow, i as withResourceDeadline, j as stringifyValue, k as shouldRetainResource, l as formatResourceLine, m as red, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as green, q as CFN_TEMPLATE_BODY_LIMIT, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as bold, v as ProviderRegistry, w as DagBuilder, x as IntrinsicFunctionResolver, y as findActionableSilentDrops, z as getDefaultStateBucketName } from "./deploy-engine-CyPbcsXW.js";
4
+ import { A as AssetPublisher, B as getLegacyStateBucketName, C as DiffCalculator, D as S3StateBackend, E as LockManager, F as getDockerCmd, G as resolveStateBucketWithDefaultAndSource, H as resolveCaptureObservedState, I as runDockerForeground, J as CFN_TEMPLATE_URL_LIMIT, K as warnDeprecatedNoPrefixCliFlag, L as runDockerStreaming, M as WorkGraph, N as buildDockerImage, O as rebuildClientForBucketRegion, P as formatDockerLoginError, Q as AssemblyReader, R as Synthesizer, S as applyRoleArnIfSet, T as TemplateParser, U as resolveSkipPrefix, V as resolveApp, W as resolveStateBucketWithDefault, X as findLargeInlineResources, Y as MIGRATE_TMP_PREFIX, Z as uploadCfnTemplate, _ as collectInlinePolicyNamesManagedBySiblings, a as withRetry, b as CloudControlProvider, c as extractDeploymentEventError, d as cyan, et as resolveBucketRegion, f as gray, g as IAMRoleProvider, h as yellow, i as withResourceDeadline, j as stringifyValue, k as shouldRetainResource, l as formatResourceLine, m as red, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as green, q as CFN_TEMPLATE_BODY_LIMIT, r as DeployEngine, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as bold, v as ProviderRegistry, w as DagBuilder, x as IntrinsicFunctionResolver, y as findActionableSilentDrops, z as getDefaultStateBucketName } from "./deploy-engine-DlXVqVTW.js";
5
5
  import { t as ASGProvider } from "./asg-provider-B_hrCxRx.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
7
  import { randomBytes, randomUUID } from "node:crypto";
@@ -1553,7 +1553,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1553
1553
  const FLUSH_EVENT_THRESHOLD = 50;
1554
1554
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1555
1555
  function getCdkdVersion() {
1556
- return "0.221.3";
1556
+ return "0.221.5";
1557
1557
  }
1558
1558
  /**
1559
1559
  * Generate a time-sortable unique run id, e.g.
@@ -36843,17 +36843,55 @@ async function loadStateOrEmpty(stackName, region, stateBackend) {
36843
36843
  * Pure with respect to AWS state mutation — only reads state (the resolver
36844
36844
  * may read producer state for `Fn::ImportValue` / `Fn::GetStackOutput`).
36845
36845
  */
36846
- async function computeStackDiff(currentState, template, region, stackName, stateBackend, diffCalculator) {
36846
+ async function computeStackDiff(currentState, template, region, stackName, stateBackend, diffCalculator, parameters) {
36847
36847
  const intrinsicResolver = new IntrinsicFunctionResolver(region);
36848
36848
  const resolveFn = (value) => intrinsicResolver.resolve(value, {
36849
36849
  template,
36850
36850
  resources: currentState.resources,
36851
36851
  stateBackend,
36852
- stackName
36852
+ stackName,
36853
+ ...parameters && { parameters }
36853
36854
  });
36854
36855
  return diffCalculator.calculateDiff(currentState, template, resolveFn);
36855
36856
  }
36856
36857
  /**
36858
+ * Resolve a nested-stack child's input `Parameters` (declared on the parent's
36859
+ * `AWS::CloudFormation::Stack` row under `Properties.Parameters`) to scalar
36860
+ * values against the PARENT's deployed state + already-resolved parameters.
36861
+ *
36862
+ * This is the diff-time analogue of `NestedStackProvider.extractParameters`:
36863
+ * the deploy engine resolves these same `Parameters` against the parent's
36864
+ * resolver context and forwards the scalar map to the child engine as
36865
+ * `DeployEngineOptions.parameters`, so a `Ref` to a child input parameter
36866
+ * resolves at deploy time. The recursive diff must do the same or it reports
36867
+ * spurious changes on every freshly-deployed nested child whose property
36868
+ * derives from a passed-down parameter.
36869
+ *
36870
+ * Each value is resolved independently and best-effort: a value that cannot
36871
+ * be resolved (e.g. a `Ref` to a resource not yet in state) is dropped from
36872
+ * the map rather than forwarded as a raw intrinsic — leaving it out means the
36873
+ * child's `Ref` to that parameter falls through to the existing
36874
+ * intrinsic-vs-resolved comparison path (no behavior change for the
36875
+ * unresolvable case), while resolvable parameters (the freshly-deployed tree)
36876
+ * get exact scalar values.
36877
+ */
36878
+ async function resolveChildStackParameters(parentStackRow, parentTemplate, parentState, region, parentStackName, stateBackend, parentParameters) {
36879
+ const rawParams = parentStackRow.Properties?.["Parameters"];
36880
+ if (!rawParams || typeof rawParams !== "object" || Array.isArray(rawParams)) return {};
36881
+ const resolver = new IntrinsicFunctionResolver(region);
36882
+ const resolved = {};
36883
+ for (const [name, value] of Object.entries(rawParams)) try {
36884
+ resolved[name] = await resolver.resolve(value, {
36885
+ template: parentTemplate,
36886
+ resources: parentState.resources,
36887
+ stateBackend,
36888
+ stackName: parentStackName,
36889
+ ...parentParameters && { parameters: parentParameters }
36890
+ });
36891
+ } catch {}
36892
+ return resolved;
36893
+ }
36894
+ /**
36857
36895
  * Build the diff tree for one stack and (when `recursive`) every nested
36858
36896
  * `AWS::CloudFormation::Stack` descendant.
36859
36897
  *
@@ -36874,13 +36912,13 @@ async function computeStackDiff(currentState, template, region, stackName, state
36874
36912
  * fail at deploy time.
36875
36913
  */
36876
36914
  async function buildDiffTree(args) {
36877
- const { stackName, displayName, region, template, nestedTemplates, recursive, stateBackend, diffCalculator } = args;
36915
+ const { stackName, displayName, region, template, nestedTemplates, recursive, stateBackend, diffCalculator, parameters } = args;
36878
36916
  const state = await loadStateOrEmpty(stackName, region, stateBackend);
36879
36917
  const node = {
36880
36918
  stackName,
36881
36919
  displayName,
36882
36920
  region,
36883
- changes: await computeStackDiff(state, template, region, stackName, stateBackend, diffCalculator),
36921
+ changes: await computeStackDiff(state, template, region, stackName, stateBackend, diffCalculator, parameters),
36884
36922
  ccApiRoutes: collectCcApiRoutes(template, state),
36885
36923
  children: []
36886
36924
  };
@@ -36894,6 +36932,7 @@ async function buildDiffTree(args) {
36894
36932
  const childStackName = `${stackName}~${logicalId}`;
36895
36933
  const childTemplate = readNestedTemplate(childTemplatePath);
36896
36934
  const grandchildTemplates = indexNestedChildTemplates(childTemplate, childTemplatePath);
36935
+ const childParameters = await resolveChildStackParameters(resource, template, state, region, stackName, stateBackend, parameters);
36897
36936
  node.children.push(await buildDiffTree({
36898
36937
  stackName: childStackName,
36899
36938
  displayName: childStackName,
@@ -36902,7 +36941,8 @@ async function buildDiffTree(args) {
36902
36941
  nestedTemplates: grandchildTemplates,
36903
36942
  recursive: true,
36904
36943
  stateBackend,
36905
- diffCalculator
36944
+ diffCalculator,
36945
+ parameters: childParameters
36906
36946
  }));
36907
36947
  }
36908
36948
  for (const [logicalId, resource] of Object.entries(state.resources)) {
@@ -53802,7 +53842,7 @@ function reorderArgs(argv) {
53802
53842
  async function main() {
53803
53843
  installPipeCloseHandler();
53804
53844
  const program = new Command();
53805
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.221.3");
53845
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.221.5");
53806
53846
  program.addCommand(createBootstrapCommand());
53807
53847
  program.addCommand(createSynthCommand());
53808
53848
  program.addCommand(createListCommand());