@go-to-k/cdkd 0.229.1 → 0.229.3

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 { $ as findLargeInlineResources, A as shouldRetainResource, B as getDockerImageBySourceHash, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveCaptureObservedState, H as getDefaultStateBucketName, I as getDockerCmd, J as resolveStateBucketWithDefaultAndSource, K as resolveSkipPrefix, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as MIGRATE_TMP_PREFIX, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as getLegacyStateBucketName, V as Synthesizer, W as resolveApp, X as CFN_TEMPLATE_BODY_LIMIT, Y as warnDeprecatedNoPrefixCliFlag, Z as CFN_TEMPLATE_URL_LIMIT, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, et as uploadCfnTemplate, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as resolveStateBucketWithDefault, r as DeployEngine, rt as resolveBucketRegion, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as AssemblyReader, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as AssetManifestLoader } from "./deploy-engine-BRZdKXDs.js";
4
+ import { $ as findLargeInlineResources, A as shouldRetainResource, B as getDockerImageBySourceHash, C as applyRoleArnIfSet, D as LockManager, E as TemplateParser, F as formatDockerLoginError, G as resolveCaptureObservedState, H as getDefaultStateBucketName, I as getDockerCmd, J as resolveStateBucketWithDefaultAndSource, K as resolveSkipPrefix, L as runDockerForeground, M as stringifyValue, N as WorkGraph, O as S3StateBackend, P as buildDockerImage, Q as MIGRATE_TMP_PREFIX, R as runDockerStreaming, S as IntrinsicFunctionResolver, T as DagBuilder, U as getLegacyStateBucketName, V as Synthesizer, W as resolveApp, X as CFN_TEMPLATE_BODY_LIMIT, Y as warnDeprecatedNoPrefixCliFlag, Z as CFN_TEMPLATE_URL_LIMIT, _ as IAMRoleProvider, a as withRetry, b as findActionableSilentDrops, c as computeImplicitDeleteEdges, d as bold, et as uploadCfnTemplate, f as cyan, g as yellow, h as red, i as withResourceDeadline, j as AssetPublisher, k as rebuildClientForBucketRegion, l as extractDeploymentEventError, m as green, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as isRetryableTransientError, p as gray, q as resolveStateBucketWithDefault, r as DeployEngine, rt as resolveBucketRegion, s as IMPLICIT_DELETE_DEPENDENCIES, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as AssemblyReader, u as formatResourceLine, v as collectInlinePolicyNamesManagedBySiblings, w as DiffCalculator, x as CloudControlProvider, y as ProviderRegistry, z as AssetManifestLoader } from "./deploy-engine-gl_fTFek.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";
@@ -1556,7 +1556,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1556
1556
  const FLUSH_EVENT_THRESHOLD = 50;
1557
1557
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1558
1558
  function getCdkdVersion() {
1559
- return "0.229.1";
1559
+ return "0.229.3";
1560
1560
  }
1561
1561
  /**
1562
1562
  * Generate a time-sortable unique run id, e.g.
@@ -55004,7 +55004,7 @@ function reorderArgs(argv) {
55004
55004
  async function main() {
55005
55005
  installPipeCloseHandler();
55006
55006
  const program = new Command();
55007
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.229.1");
55007
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.229.3");
55008
55008
  program.addCommand(createBootstrapCommand());
55009
55009
  program.addCommand(createSynthCommand());
55010
55010
  program.addCommand(createListCommand());
@@ -5597,6 +5597,22 @@ async function applyRoleArnIfSet(opts) {
5597
5597
  */
5598
5598
  const AWS_NO_VALUE = Symbol("AWS::NoValue");
5599
5599
  /**
5600
+ * Resource types whose CloudFormation `Ref` returns the segment AFTER the pipe
5601
+ * in cdkd's compound Cloud Control physical id `<parent>|<ref>` (rather than the
5602
+ * whole physical id). These are Cloud-Control-provisioned types whose CC
5603
+ * primaryIdentifier is compound `<parentId>|<ref>` while CFn's `Ref` returns
5604
+ * only the trailing `<ref>` component:
5605
+ * - AWS::ApiGateway::Model `<restApiId>|<modelName>` -> model name
5606
+ * - AWS::ApiGateway::RequestValidator `<restApiId>|<validatorId>` -> validator id
5607
+ * - AWS::Cognito::UserPoolClient `<userPoolId>|<clientId>` -> client id
5608
+ * See {@link IntrinsicFunctionResolver.resolveRefValue}.
5609
+ */
5610
+ const REF_RETURNS_SEGMENT_AFTER_PIPE = new Set([
5611
+ "AWS::ApiGateway::Model",
5612
+ "AWS::ApiGateway::RequestValidator",
5613
+ "AWS::Cognito::UserPoolClient"
5614
+ ]);
5615
+ /**
5600
5616
  * Intrinsic-function keys the resolver knows how to handle.
5601
5617
  *
5602
5618
  * A CloudFormation intrinsic is ALWAYS a single-key object — `{ "Ref": ... }`
@@ -5878,8 +5894,9 @@ var IntrinsicFunctionResolver = class {
5878
5894
  async resolveRef(logicalId, context) {
5879
5895
  const resource = context.resources[logicalId];
5880
5896
  if (resource) {
5881
- this.logger.debug(`Resolved Ref to resource: ${logicalId} -> ${resource.physicalId}`);
5882
- return resource.physicalId;
5897
+ const refValue = this.resolveRefValue(resource);
5898
+ this.logger.debug(`Resolved Ref to resource: ${logicalId} -> ${refValue}`);
5899
+ return refValue;
5883
5900
  }
5884
5901
  if (context.parameters && logicalId in context.parameters) {
5885
5902
  const value = context.parameters[logicalId];
@@ -5896,6 +5913,42 @@ var IntrinsicFunctionResolver = class {
5896
5913
  throw new Error(`Ref ${logicalId} not found`);
5897
5914
  }
5898
5915
  /**
5916
+ * Resolve the value a CloudFormation `Ref` returns for a resource.
5917
+ *
5918
+ * For most resource types `Ref` returns the physical id, which is what cdkd
5919
+ * stores. But for a few types CFn's `Ref` returns a sub-component of the
5920
+ * physical id, and returning the raw physical id breaks downstream consumers.
5921
+ *
5922
+ * The {@link REF_RETURNS_SEGMENT_AFTER_PIPE} types are provisioned via Cloud
5923
+ * Control (no SDK provider), whose primary identifier — and thus cdkd's
5924
+ * physical id — is the compound `<parentId>|<ref>`, while CFn's `Ref` returns
5925
+ * only the trailing `<ref>` segment:
5926
+ * - `AWS::ApiGateway::Model` → Ref is the model NAME; physical id is
5927
+ * `<restApiId>|<modelName>`. A method wiring
5928
+ * `RequestModels: { "application/json": { "Ref": <Model> } }` would
5929
+ * otherwise get the compound id and API Gateway rejects it with
5930
+ * "Invalid model identifier specified".
5931
+ * - `AWS::ApiGateway::RequestValidator` → Ref is the RequestValidatorId;
5932
+ * physical id is `<restApiId>|<requestValidatorId>`. A method wiring
5933
+ * `RequestValidatorId: { "Ref": <Validator> }` would otherwise get the
5934
+ * compound id and API Gateway rejects it with
5935
+ * "Invalid Request Validator identifier specified".
5936
+ * - `AWS::Cognito::UserPoolClient` → Ref is the client id; physical id is
5937
+ * `<userPoolId>|<clientId>`. Any consumer of the client id (a CfnOutput,
5938
+ * a Lambda env var, `cognito-idp` API calls) would otherwise get the
5939
+ * compound id, which fails the `[\w+]+` client-id validation.
5940
+ * In every case the `Ref` value is the segment after the pipe (the parent id
5941
+ * is the first identifier component).
5942
+ */
5943
+ resolveRefValue(resource) {
5944
+ const physicalId = resource.physicalId;
5945
+ if (REF_RETURNS_SEGMENT_AFTER_PIPE.has(resource.resourceType)) {
5946
+ const pipeIdx = physicalId.indexOf("|");
5947
+ if (pipeIdx >= 0) return physicalId.substring(pipeIdx + 1);
5948
+ }
5949
+ return physicalId;
5950
+ }
5951
+ /**
5899
5952
  * Resolve Fn::GetAtt intrinsic function
5900
5953
  */
5901
5954
  async resolveGetAtt(getAtt, context) {
@@ -13442,4 +13495,4 @@ var DeployEngine = class {
13442
13495
 
13443
13496
  //#endregion
13444
13497
  export { findLargeInlineResources as $, shouldRetainResource as A, getDockerImageBySourceHash as B, applyRoleArnIfSet as C, LockManager as D, TemplateParser as E, formatDockerLoginError as F, resolveCaptureObservedState as G, getDefaultStateBucketName as H, getDockerCmd as I, resolveStateBucketWithDefaultAndSource as J, resolveSkipPrefix as K, runDockerForeground as L, stringifyValue as M, WorkGraph as N, S3StateBackend as O, buildDockerImage as P, MIGRATE_TMP_PREFIX as Q, runDockerStreaming as R, IntrinsicFunctionResolver as S, DagBuilder as T, getLegacyStateBucketName as U, Synthesizer as V, resolveApp as W, CFN_TEMPLATE_BODY_LIMIT as X, warnDeprecatedNoPrefixCliFlag as Y, CFN_TEMPLATE_URL_LIMIT as Z, IAMRoleProvider as _, withRetry as a, findActionableSilentDrops as b, computeImplicitDeleteEdges as c, bold as d, uploadCfnTemplate as et, cyan as f, yellow as g, red as h, withResourceDeadline as i, AssetPublisher as j, rebuildClientForBucketRegion as k, extractDeploymentEventError as l, green as m, DEFAULT_RESOURCE_WARN_AFTER_MS as n, clearBucketRegionCache as nt, isRetryableTransientError as o, gray as p, resolveStateBucketWithDefault as q, DeployEngine as r, resolveBucketRegion as rt, IMPLICIT_DELETE_DEPENDENCIES as s, DEFAULT_RESOURCE_TIMEOUT_MS as t, AssemblyReader as tt, formatResourceLine as u, collectInlinePolicyNamesManagedBySiblings as v, DiffCalculator as w, CloudControlProvider as x, ProviderRegistry as y, AssetManifestLoader as z };
13445
- //# sourceMappingURL=deploy-engine-BRZdKXDs.js.map
13498
+ //# sourceMappingURL=deploy-engine-gl_fTFek.js.map