@go-to-k/cdkd 0.289.0 → 0.289.2

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-CCKo6fK2.js";
2
+ import { n as isVersionOnlyInvocation, t as getCdkdVersion } from "./version-DUhfbsEF.js";
3
3
 
4
4
  //#region src/cli/pipe-close-handler.ts
5
5
  /**
@@ -74,7 +74,7 @@ async function main() {
74
74
  console.log(getCdkdVersion());
75
75
  return;
76
76
  }
77
- const { buildProgram } = await import("./program-Bg60hZhr.js");
77
+ const { buildProgram } = await import("./program-Du5rJeYT.js");
78
78
  const program = buildProgram();
79
79
  const args = reorderArgs(process.argv);
80
80
  await program.parseAsync(args);
@@ -1,6 +1,6 @@
1
1
  import { d as applyDefaultNameForFallback, f as explicitNamePropertyFor, g as looksLikeCdkdGeneratedName, h as getCurrentStackName, m as generateResourceNameWithFallback, n as getLogger, p as generateResourceName, r as isStdoutReservedForPayload, s as getLiveRenderer, v as withStackName } from "./logger-D2Md1kTq.js";
2
2
  import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
3
- import { t as getCdkdVersion } from "./version-CCKo6fK2.js";
3
+ import { t as getCdkdVersion } from "./version-DUhfbsEF.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { createHash, randomUUID } from "node:crypto";
6
6
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -20869,7 +20869,7 @@ function classifyReplaySecretRegion(expression, consumerRegion, importedProducer
20869
20869
  */
20870
20870
  function readConfigString(container, key, fallback, containerPath, options) {
20871
20871
  if (container === void 0 || container === null) return fallback;
20872
- if (!isPlainObject$1(container)) {
20872
+ if (!isPlainObject$1(container) || isUnresolvedIntrinsicContainer(container)) {
20873
20873
  const detail = malformedShapeDetail(container);
20874
20874
  if (options?.onUnusable) {
20875
20875
  const named = fallback === "" ? "" : ` (${fallback})`;
@@ -20949,7 +20949,7 @@ function requireConfigArray(value, path, options) {
20949
20949
  return value;
20950
20950
  }
20951
20951
  function requireConfigObject(value, path, options) {
20952
- if (!isPlainObject$1(value)) {
20952
+ if (!isPlainObject$1(value) || isUnresolvedIntrinsicContainer(value)) {
20953
20953
  const detail = malformedShapeDetail(value);
20954
20954
  if (options?.onUnusable) {
20955
20955
  options.onUnusable(`${path} must be an object ${detail}. Leaving this configuration unapplied here; the same value is REFUSED on a template-path create.`);
@@ -20980,7 +20980,7 @@ function requireConfigObject(value, path, options) {
20980
20980
  */
20981
20981
  function configStringRefusal(container, key, fallback, containerPath, options) {
20982
20982
  if (container === void 0 || container === null) return void 0;
20983
- if (!isPlainObject$1(container)) return `${containerPath} must be an object ${malformedShapeDetail(container)}`;
20983
+ if (!isPlainObject$1(container) || isUnresolvedIntrinsicContainer(container)) return `${containerPath} must be an object ${malformedShapeDetail(container)}`;
20984
20984
  return configValueRefusal(container[key], fallback, `${containerPath}.${key}`, options);
20985
20985
  }
20986
20986
  /**
@@ -21034,7 +21034,7 @@ function coerceCfnBoolean(value) {
21034
21034
  */
21035
21035
  function configBooleanRefusal(container, key, containerPath) {
21036
21036
  if (container === void 0 || container === null) return void 0;
21037
- if (!isPlainObject$1(container)) return `${containerPath} must be an object ${malformedShapeDetail(container)}`;
21037
+ if (!isPlainObject$1(container) || isUnresolvedIntrinsicContainer(container)) return `${containerPath} must be an object ${malformedShapeDetail(container)}`;
21038
21038
  const value = container[key];
21039
21039
  if (value === void 0) return void 0;
21040
21040
  if (coerceCfnBoolean(value) !== void 0) return void 0;
@@ -21055,6 +21055,7 @@ function configValueRefusal(value, fallback, path, options) {
21055
21055
  * only, which is invisible in review.
21056
21056
  */
21057
21057
  function malformedShapeDetail(value) {
21058
+ if (isPlainObject$1(value) && isUnresolvedIntrinsicContainer(value)) return `(got ${describe(value)} — nothing substituted it before this call)`;
21058
21059
  return `(got ${describe(value)}) — check for an unresolved intrinsic or a mis-nested template value`;
21059
21060
  }
21060
21061
  /**
@@ -21066,11 +21067,121 @@ function malformedShapeDetail(value) {
21066
21067
  function isPlainObject$1(value) {
21067
21068
  return typeof value === "object" && value !== null && !Array.isArray(value);
21068
21069
  }
21070
+ /**
21071
+ * CFn intrinsic names this module is willing to NAME in an error message.
21072
+ *
21073
+ * Display-only, and the reason is in `describe`: the message reaches
21074
+ * substring-matching retry classifiers, and a state record can carry an
21075
+ * arbitrary `Fn::*` key (`cdkd import` writes the raw intrinsic shape when it
21076
+ * cannot resolve one). An unrecognized key therefore degrades to the generic
21077
+ * wording rather than being interpolated. Nothing depends on this list being
21078
+ * complete — a missing entry costs diagnostic detail, never safety.
21079
+ */
21080
+ const NAMEABLE_INTRINSIC_KEYS = /* @__PURE__ */ new Set([
21081
+ "Ref",
21082
+ "Fn::Base64",
21083
+ "Fn::Cidr",
21084
+ "Fn::FindInMap",
21085
+ "Fn::GetAZs",
21086
+ "Fn::GetAtt",
21087
+ "Fn::GetStackOutput",
21088
+ "Fn::If",
21089
+ "Fn::ImportValue",
21090
+ "Fn::Join",
21091
+ "Fn::Select",
21092
+ "Fn::Split",
21093
+ "Fn::Sub",
21094
+ "Fn::Transform"
21095
+ ]);
21096
+ /**
21097
+ * True for a single-key object whose key is `Ref` or `Fn::*` — the shape of an
21098
+ * unresolved CloudFormation intrinsic (issue #3032).
21099
+ *
21100
+ * Every CONTAINER gate in this module needs it, which is the correction a
21101
+ * review round forced: an earlier revision of this comment claimed the sibling
21102
+ * guards were safe "by type", and that is true only of their FIELD halves. An
21103
+ * intrinsic is not a string and not an array, so {@link requireConfigArray} and
21104
+ * the value-level reads refuse it — but `readConfigString`,
21105
+ * {@link configStringRefusal} and {@link configBooleanRefusal} each open by
21106
+ * testing their CONTAINER with a bare `isPlainObject`, which an intrinsic
21107
+ * passes. The key probe then indexes to `undefined` and the FALLBACK is
21108
+ * substituted: measured on this module's own motivating case, a
21109
+ * `VersioningConfiguration` of `{ 'Fn::If': [...] }` returned `'Suspended'`,
21110
+ * i.e. versioning turned OFF on a live bucket (the #1471 headline). So all four
21111
+ * container gates test this, not just {@link requireConfigObject}.
21112
+ *
21113
+ * A REVIEW ROUND ASKED FOR THE UPDATE-PATH DOWNGRADE HERE AND IT IS WRONG,
21114
+ * which is worth recording because the general rule points the other way.
21115
+ * SEVERAL `readConfigString` UPDATE sites pass no `onUnusable` and therefore
21116
+ * now throw on an intrinsic — `route53-provider.ts` (`HostedZoneConfig`),
21117
+ * `cloudfront-oai-provider.ts` (`CloudFrontOriginAccessIdentityConfig`),
21118
+ * `kinesis-provider.ts` (`StreamModeDetails`), `ecs-provider.ts`
21119
+ * (`DeploymentController`), `secretsmanager-secret-provider.ts`
21120
+ * (`GenerateSecretString`, via `generateSecretString`) and `codebuild-provider.ts`
21121
+ * (reached from `update()` through `mapProperties`). Not a count, for the same
21122
+ * reason as the near-copy list below: two successive reviews each found
21123
+ * another. Re-derive with
21124
+ * `grep -rn 'readConfigString(' src/provisioning/providers/`.
21125
+ * That reads like the #1544 un-rollbackable hazard —
21126
+ * but each is a DELIBERATE refusal from issues #1493 / #1471, pinned by a test
21127
+ * that states the reason in its own name ("refuses a string container on
21128
+ * update, so the live comment is not blanked", "instead of assuming the ECS
21129
+ * controller"). At those sites the FALLBACK is the destructive direction: it
21130
+ * blanks a live comment or silently picks a controller. Adding the downgrade
21131
+ * reddened the existing test at every one of those sites that had one, which
21132
+ * is how the reversal was caught.
21133
+ * An intrinsic container simply inherits that recorded decision — this change
21134
+ * widens WHICH shapes are refused, never WHETHER a site refuses.
21135
+ *
21136
+ * Reachability is DOMINATED by the STATE-borne replay paths — the rollback
21137
+ * executor's reverse-replacement create, its revert arms, and
21138
+ * `cdkd drift --revert` — because a record written by an older binary can carry
21139
+ * the raw intrinsic, which is why three S3 suites already list
21140
+ * `{ 'Fn::If': [...] }` among "the malformed shapes a state record written by
21141
+ * an older binary can carry". A fresh template is MOSTLY excluded rather than
21142
+ * entirely: the resolver throws on an unresolvable `Ref` / `Fn::GetAtt` and
21143
+ * hard-errors on an unknown `Fn::*` key, so those never arrive — but
21144
+ * `Fn::Transform` is listed in its `HANDLED_INTRINSIC_KEYS` with no dispatch
21145
+ * arm (deliberately, so a stray already-expanded occurrence does not
21146
+ * hard-error), falls through the generic object walk, and reaches a provider
21147
+ * bag verbatim. Refusing it here is the right outcome anyway: an unexpanded
21148
+ * `Fn::Transform` sitting AS a container value means the macro never expanded,
21149
+ * so the block is genuinely broken and the pre-guard behaviour was a silently
21150
+ * emptied one.
21151
+ *
21152
+ * KEPT LOCAL, deliberately, and the rule is `.claude/rules/`'s own. SEVERAL
21153
+ * near-copies of this shape exist across the tree — `create-only-properties.ts`,
21154
+ * `mutually-exclusive-properties.ts`, `route53-provider.ts` and
21155
+ * `dynamodb-globaltable-provider.ts` under `src/provisioning/`, plus more in
21156
+ * `cli/commands/drift.ts`, `cli/commands/import.ts` and
21157
+ * `deployment/intrinsic-function-resolver.ts`. Deliberately NOT stated as a
21158
+ * count: three successive review rounds corrected one, each time finding
21159
+ * another. Re-derive it if you need it
21160
+ * (`grep -rn "startsWith('Fn::')" src/`) rather than trusting a number here.
21161
+ * `mutually-exclusive-properties.ts` records WHY they are not shared — the modules answer different questions about the shape and
21162
+ * must not drift into one another's behavior by accident. This module asks its OWN
21163
+ * question ("is this container a real config block, or an intrinsic wearing
21164
+ * one's shape"), so it takes its own predicate rather than overriding that
21165
+ * decision. Note the copies do NOT agree and are not meant to:
21166
+ * `dynamodb-globaltable-provider.ts` asks whether a block is ENTIRELY
21167
+ * intrinsic (`keys.every`), which is a broader question than this one.
21168
+ *
21169
+ * No CFn config block declares a property named `Ref` or `Fn::*`, so the
21170
+ * single-key test cannot misread a legitimate container.
21171
+ */
21172
+ function isUnresolvedIntrinsicContainer(value) {
21173
+ const keys = Object.keys(value);
21174
+ return keys.length === 1 && (keys[0] === "Ref" || keys[0].startsWith("Fn::"));
21175
+ }
21069
21176
  /** Human-readable type for an error message, without dumping user data. */
21070
21177
  function describe(value) {
21071
21178
  if (value === null) return "null";
21072
21179
  if (Array.isArray(value)) return "an array";
21073
21180
  if (typeof value === "string") return value.trim() === "" ? "a blank string" : "a string";
21181
+ if (isPlainObject$1(value) && isUnresolvedIntrinsicContainer(value)) {
21182
+ const key = Object.keys(value)[0];
21183
+ return NAMEABLE_INTRINSIC_KEYS.has(key) ? `an unresolved ${key} intrinsic` : "an unresolved intrinsic";
21184
+ }
21074
21185
  return typeof value === "object" ? "an object" : `a ${typeof value}`;
21075
21186
  }
21076
21187
 
@@ -27637,7 +27748,7 @@ var CloudControlProvider = class {
27637
27748
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
27638
27749
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
27639
27750
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
27640
- const { ASGProvider } = await import("./asg-provider-1XVtAjhm.js").then((n) => n.n);
27751
+ const { ASGProvider } = await import("./asg-provider-C5FQJwUN.js").then((n) => n.n);
27641
27752
  const asgProvider = new ASGProvider();
27642
27753
  return withIndeterminateGuard(await asgProvider.delete(logicalId, physicalId, resourceType, _properties, context), indeterminateGuard);
27643
27754
  }
@@ -38984,7 +39095,10 @@ var DeployEngine = class DeployEngine {
38984
39095
  recordNestedStackParameterExpressions(updateSecrets, resourceType, resolvedProps, desiredProps);
38985
39096
  this.auditResolvedAssetReferences(logicalId, resourceType, resolvedProps);
38986
39097
  this.attemptedResolvedProps.set(logicalId, resolvedProps);
38987
- if (JSON.stringify(redactSecretsForState(markSameGenerationBag({ ...resolvedProps }), updateSecrets, desiredProps)) === JSON.stringify(currentPropsAsWritten)) {
39098
+ const desiredForSkipCheck = redactSecretsForState(markSameGenerationBag({ ...resolvedProps }), updateSecrets, desiredProps);
39099
+ const allowedSilentDrops = this.providerRegistry.getAllowedUnsupportedProperties?.();
39100
+ const desiredForSkipCheckAsWritten = currentResource.provisionedBy !== "cc-api" && allowedSilentDrops ? withoutAcceptedSilentDropProperties(resourceType, desiredForSkipCheck, allowedSilentDrops) : desiredForSkipCheck;
39101
+ if (JSON.stringify(desiredForSkipCheckAsWritten) === JSON.stringify(currentPropsAsWritten)) {
38988
39102
  if (change.attributeChanges && change.attributeChanges.length > 0) {
38989
39103
  const attrSummary = change.attributeChanges.map((a) => `${a.attribute}: ${a.oldValue ?? "(unset)"} → ${a.newValue ?? "(unset)"}`).join(", ");
38990
39104
  this.logger.info(` ↻ ${logicalId} (${resourceType}) attribute update: ${attrSummary}`);
@@ -39971,4 +40085,4 @@ var DeployEngine = class DeployEngine {
39971
40085
 
39972
40086
  //#endregion
39973
40087
  export { collectInlinePolicyNamesManagedBySiblings as $, describeDockerCapturedOutput as $n, LocalInvokeBuildError as $r, DagBuilder as $t, isStatefulRecreateTargetForReplace as A, orphansAfterRollback as An, uploadCfnTemplate as Ar, coerceCfnBoolean as At, gray as B, AssetModeResolver as Bn, resolveBucketRegion as Br, withSharedDrainBudget as Bt, refusesFinalSnapshot as C, forceQuitRecoveryClause as Cn, resolveUseCdkBootstrapAssets as Cr, isUnboundTemplateParameter as Ct, makeSiblingClaimReader as D, exportNamesCarriedFrom as Dn, CFN_TEMPLATE_URL_LIMIT as Dr, normalizeAwsTagsToCfn as Dt, extractDeploymentEventError as E, DEFAULT_STATE_PREFIX as En, CFN_TEMPLATE_BODY_LIMIT as Er, WAFv2WebACLProvider as Et, isWarmThroughputDecrease as F, WorkGraph as Fn, canonicalizeRegion as Fr, requireConfigArray as Ft, collectPublishedOutputNames as G, isCrossRegionRedirect as Gn, AssetError as Gr, s3BucketWebsiteUrl as Gt, red as H, assertAssetBucketRegion as Hn, getAwsClients as Hr, s3BucketDomainName as Ht, toFiniteNumber as I, buildAssetRedirectMap as In, derivePartitionAndUrlSuffix as Ir, requireConfigObject as It, secretBearing as J, validateAssetBucketName as Jn, CrossAccountSecretRefusalError as Jr, INTRINSIC_KEYS as Jt, exportAliasCollisionScrubWarning as K, parseBootstrapMarker as Kn, CdkdError as Kr, applyRoleArnIfSet as Kt, formatResourceLine as L, createAssetRedirectResolver as Ln, AssemblyReader as Lr, requireConfigString as Lt, renderStatefulReason as M, shouldRetainResource as Mn, displaySafe as Mr, configStringRefusal as Mt, WARM_THROUGHPUT_MEMBERS as N, AssetPublisher as Nn, expectedOwnerParam as Nr, readConfigString as Nt, planOrphanAdoption as O, importableOutputKeys as On, MIGRATE_TMP_PREFIX as Or, resolveExplicitPhysicalId as Ot, coerceWarmThroughput as P, stringifyValue as Pn, PARTITION_TABLE as Pr, replayWarn as Pt, IAMRoleProvider as Q, buildDockerImage as Qn, IntrinsicResolutionRefusalError as Qr, withRetry as Qt, bold as R, loadPublishableAssetManifest as Rn, processStackMessages as Rr, classifyReplaySecretRegion as Rt, isFinalSnapshotError as S, __exportAll as Si, buildLockContentionMessage as Sn, resolveStateBucketWithDefaultAndSource as Sr, getAccountInfo as St, makeCanonicalizePropertiesFn as T, CUSTOM_RESOURCE_RESPONSE_PREFIX as Tn, warnDeprecatedNoPrefixCliFlag as Tr, refStateLookupFromResource as Tt, yellow as U, ensureAssetStorage as Un, resetAwsClients as Ur, s3BucketDualStackDomainName as Ut, green as V, BOOTSTRAP_MARKER_PREFIX as Vn, AwsClients as Vr, s3BucketArn as Vt, collectDeclaredOutputNames as W, getBootstrapMarkerKey as Wn, setAwsClients as Wr, s3BucketRegionalDomainName as Wt, secretSafeKeyDisplay as X, buildDenyExternalAccessPolicy as Xn, DeployCancelledError as Xr, findSilentDropProperties as Xt, secretBearingStateKeyWarning as Y, validateContainerRepoName as Yn, DependencyError as Yr, findActionableSilentDrops as Yt, getCurrentResourceSecrets as Z, describeAwsFailure as Zn, DynamicReferenceRegionAmbiguousError as Zr, describeTypeWithThrottleRetry as Zt, ATOMIC_FINAL_SNAPSHOT_TYPES as _, isThrottlingError as _i, LockManager as _n, resolveApp as _r, isTerminationProtectionPropagationError as _t, DeploymentEventsStore as a, ResourceTimeoutError as ai, carriesSecretMask as an, partitionSensitiveEnv as ar, maskerOrIdentity as at, ccRoutedFinalSnapshotError as b, markRedactedCause as bi, UNRENDERABLE as bn, resolveSkipPrefix as br, cfnRefValueFromPhysicalId as bt, replayFailedOperations as c, StackTerminationProtectionError as ci, errorCauseChain as cn, runDockerStreaming as cr, interruptWatchListenerCount as ct, updatePartialReason as d, formatError as di, maskSecretsInError as dn, AssetManifestLoader as dr, CloudControlProvider as dt, LocalStartServiceError as ei, TemplateParser as en, describeDockerExecFailure as er, clearOnUpdateRemoval as et, withResourceDeadline as f, isCdkdError as fi, maskSecretsInText as fn, getDockerImageBySourceHash as fr, slowCcOperationTimeoutMs as ft, bindingSkippedOutputs as g, isRetryableTransientError as gi, scrubResourceRecord as gn, getLegacyStateBucketName as gr, disableInstanceApiTermination as gt, computeImplicitDeleteEdges as h, isMarkedNonRetryable as hi, redactSecretsForState as hn, getDefaultStateBucketName as hr, deleteSkipReason as ht, DeploymentEventsReader as i, ProvisioningError as ii, TEMPLATE_SOURCED_RULES as in, getDockerCmd as ir, maskDeep as it, isStatefulRecreateTargetSync as j, orphansCarriedFrom as jn, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as jr, configBooleanRefusal as jt, MULTI_REGION_RECREATE_BLOCKED_TYPES as k, importableOutputs as kn, findLargeInlineResources as kr, assertRegionMatch as kt, replayRollback as l, StateError as li, identityKeyFor as ln, escapeRegExp$1 as lr, isInterruptedWaitError as lt, IMPLICIT_DELETE_DEPENDENCIES as m, withErrorHandling as mi, recoverMaskedOutput as mn, synthesisStatusMessage as mr, deleteIndeterminateGuards as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, NestedStackChildDirectDestroyError as ni, STATE_SOURCED_CROSS_GENERATION_RULES as nn, dockerSpawnEnvWithSensitive as nr, wouldReturnToSdkProvider as nt, planFailedOps as o, ResourceUpdateNotSupportedError as oi, createSecretMasker as on, redactDockerArgvValues as or, beginCommandInterruptScope as ot, maskingRetryLogger as p, normalizeAwsError as pi, recordMaskOnlyValue as pn, Synthesizer as pr, UNSPECIFIED_SKIP_REASON as pt, isExportAliasCollision as q, readBootstrapMarkerBody as qn, ConfigError as qr, DiffCalculator as qt, DeployEngine as r, PartialFailureError as ri, STATE_SOURCED_READBACK_RULES as rn, formatDockerLoginError as rr, createMaskedRetryLogger as rt, planRollback as s, StackHasActiveImportsError as si, dynamicReferenceTokens as sn, runDockerForeground as sr, endCommandInterruptScope as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, LockError as ti, STATE_SOURCED_BASELINE_RULES as tn, describeDockerFailure as tr, ProviderRegistry as tt, updatePartialMessage as u, SynthesisError as ui, isSingleDynamicReferenceToken as un, stripControlChars as ur, startInterruptWatch as ut, PRE_DELETE_SNAPSHOT_TYPES as v, isTransientServerError as vi, S3StateBackend as vn, resolveAutoAssetStorage as vr, IntrinsicFunctionResolver as vt, unsupportedFinalSnapshotError as w, shellQuote as wn, stateBucketExistenceConfirmed as wr, parameterTypeMayLoseSecretIdentity as wt, createPreDeleteFinalSnapshot as x, retryClassificationText as xi, buildForceUnlockCommand as xn, resolveStateBucketWithDefault as xr, coerceParameterTypedValue as xt, buildFinalSnapshotIdentifier as y, markNonRetryable as yi, rebuildClientForBucketRegion as yn, resolveCaptureObservedState as yr, carriesDynamicReference as yt, cyan as z, rewriteTemplateAssetReferences as zn, clearBucketRegionCache as zr, producerRegionsFromState as zt };
39974
- //# sourceMappingURL=deploy-engine-B6pEfNd9.js.map
40088
+ //# sourceMappingURL=deploy-engine-ClLLdy68.js.map