@go-to-k/cdkd 0.284.73 → 0.284.75
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/{asg-provider-xXB0aei5.js → asg-provider-DdsyGm69.js} +2 -2
- package/dist/{asg-provider-xXB0aei5.js.map → asg-provider-DdsyGm69.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-DjcVPGO-.js → deploy-engine-B6xURS3W.js} +81 -26
- package/dist/{deploy-engine-DjcVPGO-.js.map → deploy-engine-B6xURS3W.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-BlS4t1DG.js → program-DQwxvn6O.js} +149 -26
- package/dist/{program-BlS4t1DG.js.map → program-DQwxvn6O.js.map} +1 -1
- package/dist/{version-NRgaYAmx.js → version-B8O0NnWg.js} +2 -2
- package/dist/{version-NRgaYAmx.js.map → version-B8O0NnWg.js.map} +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
2
|
+
import { t as getCdkdVersion } from "./version-B8O0NnWg.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, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -15679,6 +15679,48 @@ function collectReferencedParameterNames(template) {
|
|
|
15679
15679
|
return referenced;
|
|
15680
15680
|
}
|
|
15681
15681
|
/**
|
|
15682
|
+
* Is `name` a template Parameter this caller has left UNBOUND — declared, with
|
|
15683
|
+
* no `Default`, and with no value supplied?
|
|
15684
|
+
* (issue [#2285](https://github.com/go-to-k/cdkd/issues/2285))
|
|
15685
|
+
*
|
|
15686
|
+
* ONE predicate, consulted VERBATIM by the two sites that ask this same
|
|
15687
|
+
* question, rather than two spellings that agree until they do not:
|
|
15688
|
+
*
|
|
15689
|
+
* - {@link IntrinsicFunctionResolver.resolveParameters} raises
|
|
15690
|
+
* `Parameter <name> is required ...` for exactly this population. It is the
|
|
15691
|
+
* UPFRONT validation, and it runs on every path that binds parameters at
|
|
15692
|
+
* all (`deploy-engine`'s step 2.5, `diff-recursive`, `scrub`, `import`), so
|
|
15693
|
+
* a plain `cdkd deploy` never reaches the resolver with this population at
|
|
15694
|
+
* all -- it has already failed.
|
|
15695
|
+
* - {@link IntrinsicFunctionResolver.subPlaceholderNamesADeclaredTemplateEntity}
|
|
15696
|
+
* answers for the callers that CATCH that error and resolve anyway.
|
|
15697
|
+
* `cdkd import --migrate-from-cloudformation` is the live one: it logs the
|
|
15698
|
+
* parameter-resolution failure and continues with an EMPTY bag, on a context
|
|
15699
|
+
* that is NOT `bestEffort`, so `${Stage}` used to be written verbatim into
|
|
15700
|
+
* the imported resource's persisted properties -- and from there into the
|
|
15701
|
+
* next deploy's desired bag, which is how the literal reaches AWS.
|
|
15702
|
+
*
|
|
15703
|
+
* A key PRESENT with an `undefined` value is not a binding: `resolveParameters`
|
|
15704
|
+
* falls through such a key to the `Default` check, so the predicate must too.
|
|
15705
|
+
* That single edge is the reason this is shared code and not a paraphrase.
|
|
15706
|
+
*
|
|
15707
|
+
* A `Default`-carrying parameter the caller never merged is DELIBERATELY not
|
|
15708
|
+
* in this population. `resolveParameters` merges every `Default` it sees, so
|
|
15709
|
+
* the only way to reach the resolver with one unbound is to have discarded the
|
|
15710
|
+
* whole bag -- and refusing there would newly hard-fail input cdkd accepts
|
|
15711
|
+
* today, for a parameter whose value the template itself declares.
|
|
15712
|
+
*/
|
|
15713
|
+
function isUnboundTemplateParameter(name, template, boundParameters) {
|
|
15714
|
+
const declaredParameters = template?.Parameters;
|
|
15715
|
+
if (declaredParameters === void 0 || declaredParameters === null || typeof declaredParameters !== "object") return false;
|
|
15716
|
+
if (!Object.hasOwn(declaredParameters, name)) return false;
|
|
15717
|
+
const definition = declaredParameters[name];
|
|
15718
|
+
if (definition === void 0 || definition === null || typeof definition !== "object") return false;
|
|
15719
|
+
if ("Default" in definition) return false;
|
|
15720
|
+
if (boundParameters === void 0) return true;
|
|
15721
|
+
return !(name in boundParameters) || boundParameters[name] === void 0;
|
|
15722
|
+
}
|
|
15723
|
+
/**
|
|
15682
15724
|
* Does coercing to `type` risk destroying the plaintext cdkd redacts against?
|
|
15683
15725
|
*
|
|
15684
15726
|
* DERIVED from {@link coerceParameterTypedValue}, never enumerated beside it.
|
|
@@ -16206,6 +16248,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
16206
16248
|
let referencedNames;
|
|
16207
16249
|
for (const [name, definition] of Object.entries(templateParameters)) {
|
|
16208
16250
|
const paramDef = definition;
|
|
16251
|
+
if (isUnboundTemplateParameter(name, template, userParameters)) throw new Error(`Parameter ${name} is required but no value was provided and no default exists`);
|
|
16209
16252
|
if (userParameters && name in userParameters) {
|
|
16210
16253
|
const userValue = userParameters[name];
|
|
16211
16254
|
if (userValue !== void 0) {
|
|
@@ -16233,7 +16276,6 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
16233
16276
|
this.logger.debug(`Parameter ${name}: using default value ${maskInherited(stringifyParameterForLog(paramDef, paramDef.Default))}`);
|
|
16234
16277
|
continue;
|
|
16235
16278
|
}
|
|
16236
|
-
throw new Error(`Parameter ${name} is required but no value was provided and no default exists`);
|
|
16237
16279
|
}
|
|
16238
16280
|
return parameters;
|
|
16239
16281
|
}
|
|
@@ -17024,8 +17066,10 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
17024
17066
|
return `Fn::Sub variable ${varName} could not be resolved (${error instanceof Error ? error.message : String(error)}), keeping placeholder`;
|
|
17025
17067
|
}
|
|
17026
17068
|
/**
|
|
17027
|
-
* Does this `Fn::Sub` placeholder NAME
|
|
17028
|
-
* (issue [#2270](https://github.com/go-to-k/cdkd/issues/2270))
|
|
17069
|
+
* Does this `Fn::Sub` placeholder NAME an entity of this template -- a
|
|
17070
|
+
* resource (issue [#2270](https://github.com/go-to-k/cdkd/issues/2270)) or
|
|
17071
|
+
* an unbound parameter (issue
|
|
17072
|
+
* [#2285](https://github.com/go-to-k/cdkd/issues/2285))?
|
|
17029
17073
|
*
|
|
17030
17074
|
* The discriminator `resolveSub`'s catch was missing. Two very different
|
|
17031
17075
|
* things reach that catch and it collapsed both into "keep the placeholder":
|
|
@@ -17065,37 +17109,48 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
17065
17109
|
* intrinsic-sub-nested-stack-outputs.test.ts` drives each one in isolation
|
|
17066
17110
|
* (an empty `Resources` with a populated `resources`, and the reverse).
|
|
17067
17111
|
*
|
|
17068
|
-
* PARAMETERS are
|
|
17069
|
-
*
|
|
17070
|
-
*
|
|
17071
|
-
*
|
|
17072
|
-
*
|
|
17073
|
-
*
|
|
17074
|
-
*
|
|
17075
|
-
*
|
|
17076
|
-
* The
|
|
17077
|
-
*
|
|
17078
|
-
*
|
|
17079
|
-
*
|
|
17080
|
-
*
|
|
17081
|
-
*
|
|
17112
|
+
* PARAMETERS are included too, but only for the UNBOUND population
|
|
17113
|
+
* {@link isUnboundTemplateParameter} defines -- declared, no `Default`, no
|
|
17114
|
+
* bound value (issue
|
|
17115
|
+
* [#2285](https://github.com/go-to-k/cdkd/issues/2285)). `resolveRef` and
|
|
17116
|
+
* `resolvePseudoParameter` already answer for every parameter that HAS a
|
|
17117
|
+
* value, so that population is the whole of what this arm newly refuses,
|
|
17118
|
+
* and it is the one whose placeholder used to be persisted verbatim.
|
|
17119
|
+
*
|
|
17120
|
+
* The predicate is SHARED with `resolveParameters`, which raises
|
|
17121
|
+
* `Parameter <name> is required ...` for exactly the same population up
|
|
17122
|
+
* front -- so on a plain `cdkd deploy` this arm is unreachable by
|
|
17123
|
+
* construction, and what it actually covers is the caller that CATCHES that
|
|
17124
|
+
* error and resolves anyway (`cdkd import --migrate-from-cloudformation`,
|
|
17125
|
+
* on a context that is not `bestEffort`).
|
|
17126
|
+
*
|
|
17127
|
+
* A parameter carrying a `Default` the caller never merged stays OUT, for
|
|
17128
|
+
* the reason recorded on the shared predicate: refusing it would newly
|
|
17129
|
+
* hard-fail input cdkd accepts today.
|
|
17130
|
+
*
|
|
17131
|
+
* An earlier revision excluded parameters WHOLESALE and justified that by
|
|
17132
|
+
* "the routine `cdkd scrub` case (it takes no `--parameters`)". That reason
|
|
17133
|
+
* was FALSE and is recorded here so it is not reintroduced: `scrub.ts`'s `resolverContext` factory sets
|
|
17082
17134
|
* `bestEffort: true` in the same object literal that binds `template` and
|
|
17083
17135
|
* `resources`, so scrub short-circuits in `rethrowStructuralSubFailure`
|
|
17084
17136
|
* before this predicate is consulted at all — it can neither benefit from
|
|
17085
17137
|
* nor be harmed by what this function includes.
|
|
17086
17138
|
*/
|
|
17087
|
-
|
|
17139
|
+
subPlaceholderNamesADeclaredTemplateEntity(varName, context) {
|
|
17088
17140
|
const firstDot = varName.indexOf(".");
|
|
17089
17141
|
const head = firstDot >= 0 ? varName.slice(0, firstDot) : varName;
|
|
17090
17142
|
if (head === "") return false;
|
|
17091
17143
|
if (Object.hasOwn(context.resources, head)) return true;
|
|
17092
17144
|
const declared = context.template?.Resources;
|
|
17093
|
-
if (declared
|
|
17094
|
-
|
|
17145
|
+
if (declared !== void 0 && declared !== null && typeof declared === "object") {
|
|
17146
|
+
if (Object.hasOwn(declared, head)) return true;
|
|
17147
|
+
}
|
|
17148
|
+
return isUnboundTemplateParameter(head, context.template, context.parameters);
|
|
17095
17149
|
}
|
|
17096
17150
|
/**
|
|
17097
17151
|
* Refuse to launder a STRUCTURAL `Fn::Sub` failure into a literal
|
|
17098
|
-
* (
|
|
17152
|
+
* (issues [#2270](https://github.com/go-to-k/cdkd/issues/2270) and
|
|
17153
|
+
* [#2285](https://github.com/go-to-k/cdkd/issues/2285)).
|
|
17099
17154
|
*
|
|
17100
17155
|
* Called from both arms of `resolveSub`'s catch — the dotted (GetAtt) one
|
|
17101
17156
|
* and the bare (Ref) one — after the
|
|
@@ -17123,7 +17178,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
17123
17178
|
*/
|
|
17124
17179
|
rethrowStructuralSubFailure(varName, error, context) {
|
|
17125
17180
|
if (context.bestEffort) return;
|
|
17126
|
-
if (!this.
|
|
17181
|
+
if (!this.subPlaceholderNamesADeclaredTemplateEntity(varName, context)) return;
|
|
17127
17182
|
throw error;
|
|
17128
17183
|
}
|
|
17129
17184
|
/**
|
|
@@ -19459,7 +19514,7 @@ var CloudControlProvider = class {
|
|
|
19459
19514
|
await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
19460
19515
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
19461
19516
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
19462
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
19517
|
+
const { ASGProvider } = await import("./asg-provider-DdsyGm69.js").then((n) => n.n);
|
|
19463
19518
|
return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
19464
19519
|
}
|
|
19465
19520
|
const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
|
|
@@ -31343,5 +31398,5 @@ var DeployEngine = class {
|
|
|
31343
31398
|
};
|
|
31344
31399
|
|
|
31345
31400
|
//#endregion
|
|
31346
|
-
export { maskerOrIdentity as $,
|
|
31347
|
-
//# sourceMappingURL=deploy-engine-
|
|
31401
|
+
export { maskerOrIdentity as $, MIGRATE_TMP_PREFIX as $n, redactSecretsForState as $t, renderStatefulReason as A, dockerSpawnEnvWithSensitive as An, ResourceUpdateNotSupportedError as Ar, classifyReplaySecretRegion as At, exportAliasCollisionScrubWarning as B, getDefaultStateBucketName as Bn, isRetryableTransientError as Br, describeTypeWithThrottleRetry as Bt, isFinalSnapshotError as C, isCrossRegionRedirect as Cn, LocalStartServiceError as Cr, configBooleanRefusal as Ct, extractDeploymentEventError as D, validateContainerRepoName as Dn, PartialFailureError as Dr, requireConfigArray as Dt, makeCanonicalizePropertiesFn as E, validateAssetBucketName as En, NestedStackChildDirectDestroyError as Er, replayWarn as Et, green as F, runDockerStreaming as Fn, formatError as Fr, s3BucketRegionalDomainName as Ft, IAMRoleProvider as G, resolveSkipPrefix as Gn, STATE_SOURCED_READBACK_RULES as Gt, secretBearingStateKeyWarning as H, resolveApp as Hn, markNonRetryable as Hr, DagBuilder as Ht, red as I, AssetManifestLoader as In, isCdkdError as Ir, s3BucketWebsiteUrl as It, ProviderRegistry as J, resolveUseCdkBootstrapAssets as Jn, dynamicReferenceTokens as Jt, collectInlinePolicyNamesManagedBySiblings as K, resolveStateBucketWithDefault as Kn, TEMPLATE_SOURCED_RULES as Kt, yellow as L, getDockerImageBySourceHash as Ln, normalizeAwsError as Lr, applyRoleArnIfSet as Lt, bold as M, getDockerCmd as Mn, StackTerminationProtectionError as Mr, s3BucketArn as Mt, cyan as N, partitionSensitiveEnv as Nn, StateError as Nr, s3BucketDomainName as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, buildDenyExternalAccessPolicy as On, ProvisioningError as Or, requireConfigObject as Ot, gray as P, runDockerForeground as Pn, SynthesisError as Pr, s3BucketDualStackDomainName as Pt, maskDeep as Q, CFN_TEMPLATE_URL_LIMIT as Qn, maskSecretsInText as Qt, collectDeclaredOutputNames as R, Synthesizer as Rn, withErrorHandling as Rr, DiffCalculator as Rt, createPreDeleteFinalSnapshot as S, getBootstrapMarkerKey as Sn, LocalMigrateError as Sr, coerceCfnBoolean as St, unsupportedFinalSnapshotError as T, readBootstrapMarkerBody as Tn, MissingCdkCliError as Tr, readConfigString as Tt, stateKeySecretExposure as U, resolveAutoAssetStorage as Un, __exportAll as Ur, TemplateParser as Ut, isExportAliasCollision as V, getLegacyStateBucketName as Vn, isThrottlingError as Vr, withRetry as Vt, getCurrentResourceSecrets as W, resolveCaptureObservedState as Wn, STATE_SOURCED_CROSS_GENERATION_RULES as Wt, findSilentDropProperties as X, warnDeprecatedNoPrefixCliFlag as Xn, isSingleDynamicReferenceToken as Xt, findActionableSilentDrops as Y, stateBucketExistenceConfirmed as Yn, errorCauseChain as Yt, createMaskedRetryLogger as Z, CFN_TEMPLATE_BODY_LIMIT as Zn, maskSecretsInError as Zt, computeImplicitDeleteEdges as _, stripControlChars as _n, CrossAccountSecretRefusalError as _r, refStateLookupFromResource as _t, DeploymentEventsStore as a, exportNamesCarriedFrom as an, derivePartitionAndUrlSuffix as ar, isInterruptedWaitError as at, buildFinalSnapshotIdentifier as b, assertAssetBucketRegion as bn, DynamicReferenceRegionAmbiguousError as br, resolveExplicitPhysicalId as bt, replayFailedOperations as c, shouldRetainResource as cn, clearBucketRegionCache as cr, slowCcOperationTimeoutMs as ct, updatePartialReason as d, WorkGraph as dn, getAwsClients as dr, IntrinsicFunctionResolver as dt, scrubResourceRecord as en, findLargeInlineResources as er, CUSTOM_RESOURCE_RESPONSE_PREFIX as et, UNSPECIFIED_SKIP_REASON as f, buildAssetRedirectMap as fn, resetAwsClients as fr, carriesDynamicReference as ft, IMPLICIT_DELETE_DEPENDENCIES as g, escapeRegExp$1 as gn, ConfigError as gr, parameterTypeMayLoseSecretIdentity as gt, maskingRetryLogger as h, rewriteTemplateAssetReferences as hn, CdkdError as hr, isUnboundTemplateParameter as ht, DeploymentEventsReader as i, rebuildClientForBucketRegion as in, canonicalizeRegion as ir, interruptWatchListenerCount as it, formatResourceLine as j, formatDockerLoginError as jn, StackHasActiveImportsError as jr, producerRegionsFromState as jt, isStatefulRecreateTargetSync as k, buildDockerImage as kn, ResourceTimeoutError as kr, requireConfigString as kt, replayRollback as l, AssetPublisher as ln, resolveBucketRegion as lr, disableInstanceApiTermination as lt, withResourceDeadline as m, loadPublishableAssetManifest as mn, AssetError as mr, getAccountInfo as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, displaySafe as nn, expectedOwnerParam as nr, beginCommandInterruptScope as nt, planFailedOps as o, importableOutputKeys as on, AssemblyReader as or, startInterruptWatch as ot, deleteSkipReason as p, createAssetRedirectResolver as pn, setAwsClients as pr, cfnRefValueFromPhysicalId as pt, clearOnUpdateRemoval as q, resolveStateBucketWithDefaultAndSource as qn, createSecretMasker as qt, DeployEngine as r, S3StateBackend as rn, PARTITION_TABLE as rr, endCommandInterruptScope as rt, planRollback as s, importableOutputs as sn, processStackMessages as sr, CloudControlProvider as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, LockManager as tn, uploadCfnTemplate as tr, DEFAULT_STATE_PREFIX as tt, updatePartialMessage as u, stringifyValue as un, AwsClients as ur, isTerminationProtectionPropagationError as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, AssetModeResolver as vn, DependencyError as vr, WAFv2WebACLProvider as vt, refusesFinalSnapshot as w, parseBootstrapMarker as wn, LockError as wr, configStringRefusal as wt, ccRoutedFinalSnapshotError as x, ensureAssetStorage as xn, LocalInvokeBuildError as xr, assertRegionMatch as xt, PRE_DELETE_SNAPSHOT_TYPES as y, BOOTSTRAP_MARKER_PREFIX as yn, DeployCancelledError as yr, normalizeAwsTagsToCfn as yt, collectPublishedOutputNames as z, synthesisStatusMessage as zn, isMarkedNonRetryable as zr, INTRINSIC_KEYS as zt };
|
|
31402
|
+
//# sourceMappingURL=deploy-engine-B6xURS3W.js.map
|