@go-to-k/cdkd 0.284.84 → 0.284.85

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.
@@ -1,5 +1,5 @@
1
1
  import { d as generateResourceName, f as generateResourceNameWithFallback, g as withStackName, m as looksLikeCdkdGeneratedName, n as getLogger, o as getLiveRenderer, p as getCurrentStackName, u as applyDefaultNameForFallback } from "./logger-C9-E73FI.js";
2
- import { t as getCdkdVersion } from "./version-BJFNb-b3.js";
2
+ import { t as getCdkdVersion } from "./version-cNxTfzBH.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -4257,6 +4257,85 @@ function isListParameterType(type) {
4257
4257
  if (type === "CommaDelimitedList") return true;
4258
4258
  return type.length > 6 && type.startsWith("List<") && type.endsWith(">");
4259
4259
  }
4260
+ /**
4261
+ * The literal prefix of the Systems Manager parameter form. Declared ABOVE the
4262
+ * docblock below so that docblock attaches to {@link ssmResolvedValueType}
4263
+ * rather than to this constant.
4264
+ */
4265
+ const SSM_PARAMETER_VALUE_PREFIX = "AWS::SSM::Parameter::Value<";
4266
+ /**
4267
+ * ONE definition of "peel the inner shape out of
4268
+ * `AWS::SSM::Parameter::Value<...>`", returning `undefined` when `type` is not
4269
+ * that form.
4270
+ *
4271
+ * It lives beside {@link isListParameterType} for the reason that predicate
4272
+ * exists at all: this file was created by issue
4273
+ * [#2347](https://github.com/go-to-k/cdkd/issues/2347) after cdkd was found
4274
+ * holding TWO answers to one type question in these same two modules, and
4275
+ * issue [#2367](https://github.com/go-to-k/cdkd/issues/2367) then wrote a
4276
+ * SECOND peel in `src/deployment/intrinsic-function-resolver.ts` next to the
4277
+ * one already in `src/synthesis/macro-expander.ts` -- reproducing the exact
4278
+ * shape #2347 had just deleted, one question with two spellings in one file
4279
+ * pair. Both now call this.
4280
+ *
4281
+ * ## The two callers, and the one deliberate difference between them
4282
+ *
4283
+ * The peel is shared; the handling of a MALFORMED spelling is not, and that is
4284
+ * a call-site policy rather than a second answer:
4285
+ *
4286
+ * - `resolveParameters` (deployment) treats `undefined` as "do not coerce" and
4287
+ * keeps the resolved string verbatim -- the safe direction on a path that
4288
+ * writes state.
4289
+ * - `stringifyParamDefault` (synthesis) keeps its own pre-existing behaviour
4290
+ * of emitting the SCALAR placeholder for anything carrying the prefix,
4291
+ * including a malformed one, rather than falling through to its generic
4292
+ * warn + `PARAMETER_PLACEHOLDER`. Routing a malformed spelling to that
4293
+ * fallback would change the emitted placeholder text (`placeholder` ->
4294
+ * `cdkd-macro-expand-placeholder`) and add a warn line, which is a
4295
+ * behaviour change unrelated to #2367.
4296
+ *
4297
+ * The STRICTNESS here is the stricter of the two originals: a closing `>` is
4298
+ * required and the inner shape must be non-empty, so `Value<` and `Value<>`
4299
+ * peel to `undefined`. The synthesis site never required either, but it also
4300
+ * never distinguished the cases -- `''` is not list-shaped, so it took the
4301
+ * scalar arm, which is what its `undefined` branch now does explicitly.
4302
+ *
4303
+ * ## WHAT THE SUPPLIED VALUE IS -- AN OPEN DISAGREEMENT INSIDE THIS REPO
4304
+ *
4305
+ * This function answers only "what shape does `Value<...>` WRAP". It
4306
+ * deliberately does NOT settle what the value SUPPLIED for such a parameter
4307
+ * means, because cdkd currently holds two incompatible readings and this
4308
+ * function's callers do not need the answer:
4309
+ *
4310
+ * - **Read from the AWS documentation** (`cloudformation-supplied-parameter-types.html`,
4311
+ * 2026-08-29): the supplied value is ONE Parameter Store key, phrased in the
4312
+ * singular throughout ("you must specify a Parameter Store key", "you must
4313
+ * provide the parameter name"), with `Value<List<String>>` /
4314
+ * `Value<CommaDelimitedList>` described as "a Systems Manager parameter
4315
+ * whose value is a list of strings". `aws-cdk-lib`'s own
4316
+ * `StringListParameter.fromListParameterAttributes` agrees: it emits
4317
+ * `{type: 'AWS::SSM::Parameter::Value<List<String>>', default:
4318
+ * attrs.parameterName}` -- a single name.
4319
+ * - **A LIVE CloudFormation OBSERVATION** recorded at
4320
+ * `src/synthesis/macro-expander.ts` (the CR-MJ3 fix): a single-string
4321
+ * placeholder against a `Value<List<*>>` type "would reject the changeset
4322
+ * with `Parameter ... must be a list`", which is why that site emits a
4323
+ * 2-element comma-joined placeholder. Someone watched CloudFormation do
4324
+ * that, and a live observation outranks a documentation read.
4325
+ *
4326
+ * THESE MAY BOTH BE TRUE OF DIFFERENT THINGS -- CloudFormation's pre-macro
4327
+ * changeset VALIDATOR may demand a list-shaped literal while the runtime
4328
+ * resolves one key -- and that reconciliation is plausible but UNMEASURED. It
4329
+ * is recorded as unresolved rather than decided, and neither caller depends on
4330
+ * it: the synthesis site is choosing a placeholder for a validator, and the
4331
+ * deployment site is coercing a value `GetParameter` ALREADY returned, which is
4332
+ * downstream of whatever the supplied key meant.
4333
+ */
4334
+ function ssmResolvedValueType(type) {
4335
+ if (!type.startsWith("AWS::SSM::Parameter::Value<") || !type.endsWith(">")) return void 0;
4336
+ const inner = type.slice(27, -1);
4337
+ return inner.length > 0 ? inner : void 0;
4338
+ }
4260
4339
 
4261
4340
  //#endregion
4262
4341
  //#region src/synthesis/macro-expander.ts
@@ -4531,7 +4610,8 @@ function stringifyParamDefault(value, type, paramKey, logger) {
4531
4610
  const known = PARAMETER_TYPE_PLACEHOLDERS[type];
4532
4611
  if (known !== void 0) return known;
4533
4612
  if (type.startsWith("AWS::SSM::Parameter::Value<")) {
4534
- if (isListParameterType(type.slice(27, -1))) return "placeholder,placeholder";
4613
+ const inner = ssmResolvedValueType(type);
4614
+ if (inner !== void 0 && isListParameterType(inner)) return "placeholder,placeholder";
4535
4615
  return "placeholder";
4536
4616
  }
4537
4617
  logger.warn(`Parameter '${paramKey}' has unrecognized CFn Type '${type}'; using a generic string placeholder for the transient macro-expansion changeset. If CFn rejects the changeset with a type error, file an issue with the offending Type.`);
@@ -16749,6 +16829,62 @@ function coerceParameterTypedValue(value, type) {
16749
16829
  return value;
16750
16830
  }
16751
16831
  /**
16832
+ * Bind a template-declared `Default` the way the USER-SUPPLIED path binds a
16833
+ * value (issue
16834
+ * [#2367](https://github.com/go-to-k/cdkd/issues/2367)).
16835
+ *
16836
+ * `resolveParameters` writes `parameters[name]` at three sites and only the
16837
+ * user-supplied one asked the coercion anything, so a parameter declared
16838
+ * `Type: CommaDelimitedList` with `Default: "a,b,c"` and no CLI override
16839
+ * reached every consumer as the raw string -- `Fn::Select` over it threw
16840
+ * `Fn::Select: list must be an array, got string`, and a bare `Ref` handed the
16841
+ * provider a comma-joined scalar where the resource schema declares a list.
16842
+ * The defect predates the #2347 widening: it hits `CommaDelimitedList` and
16843
+ * `List<Number>`, the two list types the `switch` has recognised all along.
16844
+ *
16845
+ * CloudFormation's own documentation is written in exactly these terms --
16846
+ * `parameters-section-structure.html`'s worked example declares
16847
+ * `VpcAzs: {Type: CommaDelimitedList, Default: "us-west-2a, us-west-2b,
16848
+ * us-west-2c"}` and then reads it with `Fn::Select`, which is the case that
16849
+ * threw.
16850
+ *
16851
+ * ONLY A STRING IS COERCED, and that is the whole of the rule. `Default` is
16852
+ * typed `unknown` because it is whatever the template parser produced, and the
16853
+ * shapes are not hypothetical -- measured 2026-08-29 on both parsers cdkd
16854
+ * feeds this from:
16855
+ *
16856
+ * - `aws-cdk-lib`'s `CfnParameter._toCloudFormation` emits `Default:
16857
+ * this.default` with no conversion, so `{type: 'Number', default: 42}`
16858
+ * synthesizes the JSON NUMBER `42`, and `{type: 'CommaDelimitedList',
16859
+ * default: ['a','b','c']}` synthesizes a JSON ARRAY;
16860
+ * - `parseCfnTemplate` (`src/cli/yaml-cfn.ts`), on the `cdkd import
16861
+ * --migrate-from-cloudformation` / `cdkd export` path, resolves `Default:
16862
+ * 42` to a number, `Default: "42"` to a string, a YAML sequence to an array
16863
+ * and `Default: true` to a boolean.
16864
+ *
16865
+ * FOR THE SHAPES MEASURED ABOVE, a non-string default is already what the
16866
+ * declared type calls for -- `42` for a `Number`, `['a','b']` for a
16867
+ * `CommaDelimitedList` -- so coercing it could only damage it.
16868
+ * `String(['a,b','c'])` is `'a,b,c'`, which the split would then shred into
16869
+ * THREE elements, and `String(true)` would turn a boolean a consumer sees today
16870
+ * into text. Stringifying first is therefore not a harmless normalization, and
16871
+ * `coerceParameterTypedValue` takes a `string` precisely because parsing the
16872
+ * wire text is its whole job.
16873
+ *
16874
+ * THE CLAIM IS SCOPED TO THOSE SHAPES ON PURPOSE, because a mismatched pairing
16875
+ * is reachable and is NOT in it: YAML admits `Type: CommaDelimitedList` with
16876
+ * `Default: 42` or `Default: true`, and such a default is passed through as the
16877
+ * scalar it parsed to rather than becoming a one-element list. That is the
16878
+ * PRE-EXISTING behaviour, unchanged here and deliberately so -- a template
16879
+ * pairing a list type with a scalar default is malformed CloudFormation, and
16880
+ * inventing a coercion for it on a path that writes state is a bigger decision
16881
+ * than this fix.
16882
+ */
16883
+ function coerceParameterDefault(defaultValue, type) {
16884
+ if (typeof defaultValue !== "string") return defaultValue;
16885
+ return coerceParameterTypedValue(defaultValue, type);
16886
+ }
16887
+ /**
16752
16888
  * The inherited `plaintext -> expression` pairs that `value` CARRIES.
16753
16889
  *
16754
16890
  * ONE definition, shared by the RECORDING side
@@ -17256,11 +17392,12 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
17256
17392
  const ssmPath = String(paramDef.Default);
17257
17393
  this.logger.debug(`Parameter ${name}: resolving SSM parameter path ${ssmPath}`);
17258
17394
  const resolved = await this.resolveSSMParameter(ssmPath);
17259
- parameters[name] = resolved;
17395
+ const resolvedType = ssmResolvedValueType(paramDef.Type);
17396
+ parameters[name] = resolvedType === void 0 ? resolved : this.coerceParameterValue(resolved, resolvedType);
17260
17397
  this.logger.debug(`Parameter ${name}: resolved SSM value ${maskInherited(stringifyParameterForLog(paramDef, resolved))}`);
17261
17398
  continue;
17262
17399
  }
17263
- parameters[name] = paramDef.Default;
17400
+ parameters[name] = coerceParameterDefault(paramDef.Default, paramDef.Type);
17264
17401
  this.logger.debug(`Parameter ${name}: using default value ${maskInherited(stringifyParameterForLog(paramDef, paramDef.Default))}`);
17265
17402
  continue;
17266
17403
  }
@@ -20570,7 +20707,7 @@ var CloudControlProvider = class {
20570
20707
  await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
20571
20708
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
20572
20709
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
20573
- const { ASGProvider } = await import("./asg-provider-BeELAzdu.js").then((n) => n.n);
20710
+ const { ASGProvider } = await import("./asg-provider-CnpxfVci.js").then((n) => n.n);
20574
20711
  return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
20575
20712
  }
20576
20713
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
@@ -32559,4 +32696,4 @@ var DeployEngine = class {
32559
32696
 
32560
32697
  //#endregion
32561
32698
  export { maskerOrIdentity as $, CFN_TEMPLATE_BODY_LIMIT as $n, maskSecretsInText as $t, renderStatefulReason as A, describeAwsFailure as An, PartialFailureError as Ar, requireConfigString as At, exportAliasCollisionScrubWarning as B, Synthesizer as Bn, normalizeAwsError as Br, INTRINSIC_KEYS as Bt, isFinalSnapshotError as C, getBootstrapMarkerKey as Cn, DynamicReferenceRegionAmbiguousError as Cr, coerceCfnBoolean as Ct, extractDeploymentEventError as D, validateAssetBucketName as Dn, LockError as Dr, replayWarn as Dt, makeCanonicalizePropertiesFn as E, readBootstrapMarkerBody as En, LocalStartServiceError as Er, readConfigString as Et, green as F, partitionSensitiveEnv as Fn, StackTerminationProtectionError as Fr, s3BucketDualStackDomainName as Ft, IAMRoleProvider as G, resolveAutoAssetStorage as Gn, markNonRetryable as Gr, STATE_SOURCED_CROSS_GENERATION_RULES as Gt, secretBearingStateKeyWarning as H, getDefaultStateBucketName as Hn, isMarkedNonRetryable as Hr, withRetry as Ht, red as I, runDockerForeground as In, StateError as Ir, s3BucketRegionalDomainName as It, ProviderRegistry as J, resolveStateBucketWithDefault as Jn, __exportAll as Jr, createSecretMasker as Jt, collectInlinePolicyNamesManagedBySiblings as K, resolveCaptureObservedState as Kn, markRedactedCause as Kr, STATE_SOURCED_READBACK_RULES as Kt, yellow as L, runDockerStreaming as Ln, SynthesisError as Lr, s3BucketWebsiteUrl as Lt, bold as M, dockerSpawnEnvWithSensitive as Mn, ResourceTimeoutError as Mr, producerRegionsFromState as Mt, cyan as N, formatDockerLoginError as Nn, ResourceUpdateNotSupportedError as Nr, s3BucketArn as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, validateContainerRepoName as On, MissingCdkCliError as Or, requireConfigArray as Ot, gray as P, getDockerCmd as Pn, StackHasActiveImportsError as Pr, s3BucketDomainName as Pt, maskDeep as Q, warnDeprecatedNoPrefixCliFlag as Qn, maskSecretsInError as Qt, collectDeclaredOutputNames as R, AssetManifestLoader as Rn, formatError as Rr, applyRoleArnIfSet as Rt, createPreDeleteFinalSnapshot as S, ensureAssetStorage as Sn, DeployCancelledError as Sr, assertRegionMatch as St, unsupportedFinalSnapshotError as T, parseBootstrapMarker as Tn, LocalMigrateError as Tr, configStringRefusal as Tt, stateKeySecretExposure as U, getLegacyStateBucketName as Un, isRetryableTransientError as Ur, DagBuilder as Ut, isExportAliasCollision as V, synthesisStatusMessage as Vn, withErrorHandling as Vr, describeTypeWithThrottleRetry as Vt, getCurrentResourceSecrets as W, resolveApp as Wn, isThrottlingError as Wr, TemplateParser as Wt, findSilentDropProperties as X, resolveUseCdkBootstrapAssets as Xn, errorCauseChain as Xt, findActionableSilentDrops as Y, resolveStateBucketWithDefaultAndSource as Yn, dynamicReferenceTokens as Yt, createMaskedRetryLogger as Z, stateBucketExistenceConfirmed as Zn, isSingleDynamicReferenceToken as Zt, computeImplicitDeleteEdges as _, escapeRegExp$1 as _n, AssetError as _r, parameterTypeMayLoseSecretIdentity as _t, DeploymentEventsStore as a, rebuildClientForBucketRegion as an, expectedOwnerParam as ar, isInterruptedWaitError as at, buildFinalSnapshotIdentifier as b, BOOTSTRAP_MARKER_PREFIX as bn, CrossAccountSecretRefusalError as br, normalizeAwsTagsToCfn as bt, replayFailedOperations as c, importableOutputs as cn, derivePartitionAndUrlSuffix as cr, slowCcOperationTimeoutMs as ct, updatePartialReason as d, stringifyValue as dn, clearBucketRegionCache as dr, IntrinsicFunctionResolver as dt, redactSecretsForState as en, CFN_TEMPLATE_URL_LIMIT as er, CUSTOM_RESOURCE_RESPONSE_PREFIX as et, UNSPECIFIED_SKIP_REASON as f, WorkGraph as fn, resolveBucketRegion as fr, carriesDynamicReference as ft, IMPLICIT_DELETE_DEPENDENCIES as g, rewriteTemplateAssetReferences as gn, setAwsClients as gr, isUnboundTemplateParameter as gt, maskingRetryLogger as h, loadPublishableAssetManifest as hn, resetAwsClients as hr, getAccountInfo as ht, DeploymentEventsReader as i, S3StateBackend as in, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as ir, interruptWatchListenerCount as it, formatResourceLine as j, buildDockerImage as jn, ProvisioningError as jr, classifyReplaySecretRegion as jt, isStatefulRecreateTargetSync as k, buildDenyExternalAccessPolicy as kn, NestedStackChildDirectDestroyError as kr, requireConfigObject as kt, replayRollback as l, shouldRetainResource as ln, AssemblyReader as lr, disableInstanceApiTermination as lt, withResourceDeadline as m, createAssetRedirectResolver as mn, getAwsClients as mr, coerceParameterTypedValue as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, LockManager as nn, findLargeInlineResources as nr, beginCommandInterruptScope as nt, planFailedOps as o, exportNamesCarriedFrom as on, PARTITION_TABLE as or, startInterruptWatch as ot, deleteSkipReason as p, buildAssetRedirectMap as pn, AwsClients as pr, cfnRefValueFromPhysicalId as pt, clearOnUpdateRemoval as q, resolveSkipPrefix as qn, retryClassificationText as qr, TEMPLATE_SOURCED_RULES as qt, DeployEngine as r, displaySafe as rn, uploadCfnTemplate as rr, endCommandInterruptScope as rt, planRollback as s, importableOutputKeys as sn, canonicalizeRegion as sr, CloudControlProvider as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, scrubResourceRecord as tn, MIGRATE_TMP_PREFIX as tr, DEFAULT_STATE_PREFIX as tt, updatePartialMessage as u, AssetPublisher as un, processStackMessages as ur, isTerminationProtectionPropagationError as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, stripControlChars as vn, CdkdError as vr, refStateLookupFromResource as vt, refusesFinalSnapshot as w, isCrossRegionRedirect as wn, LocalInvokeBuildError as wr, configBooleanRefusal as wt, ccRoutedFinalSnapshotError as x, assertAssetBucketRegion as xn, DependencyError as xr, resolveExplicitPhysicalId as xt, PRE_DELETE_SNAPSHOT_TYPES as y, AssetModeResolver as yn, ConfigError as yr, WAFv2WebACLProvider as yt, collectPublishedOutputNames as z, getDockerImageBySourceHash as zn, isCdkdError as zr, DiffCalculator as zt };
32562
- //# sourceMappingURL=deploy-engine-Du2CDZop.js.map
32699
+ //# sourceMappingURL=deploy-engine-BoDdOfCO.js.map