@go-to-k/cdkd 0.284.66 → 0.284.68
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-CIhU7iyC.js → asg-provider-CRANVDS-.js} +2 -2
- package/dist/{asg-provider-CIhU7iyC.js.map → asg-provider-CRANVDS-.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-CgAjJmth.js → deploy-engine-PNoV56rY.js} +97 -10
- package/dist/{deploy-engine-CgAjJmth.js.map → deploy-engine-PNoV56rY.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-COX2YwSA.js → program-acYSO1I9.js} +5 -4
- package/dist/{program-COX2YwSA.js.map → program-acYSO1I9.js.map} +1 -1
- package/dist/{version-B2nyZsKC.js → version-r1IKN_QV.js} +2 -2
- package/dist/{version-B2nyZsKC.js.map → version-r1IKN_QV.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-r1IKN_QV.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";
|
|
@@ -18844,7 +18844,7 @@ var CloudControlProvider = class {
|
|
|
18844
18844
|
if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
|
|
18845
18845
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
18846
18846
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
18847
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
18847
|
+
const { ASGProvider } = await import("./asg-provider-CRANVDS-.js").then((n) => n.n);
|
|
18848
18848
|
return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
|
|
18849
18849
|
}
|
|
18850
18850
|
const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
|
|
@@ -20506,6 +20506,94 @@ function hasHandlerLogOutput(logTail) {
|
|
|
20506
20506
|
return logTail.split("\n").some((line) => line.trim().length > 0 && !CR_LOG_TAIL_BOILERPLATE.test(line.trimStart()));
|
|
20507
20507
|
}
|
|
20508
20508
|
/**
|
|
20509
|
+
* Parse a response body without trusting it. The body is written by the
|
|
20510
|
+
* customer's Lambda handler through a pre-signed URL, so it is UNTRUSTED
|
|
20511
|
+
* input: it may be truncated, may be a JSON scalar, or may be `null`. Every
|
|
20512
|
+
* one of those must be a normal "keep polling" outcome rather than a throw.
|
|
20513
|
+
*/
|
|
20514
|
+
function parseCfnResponseBody(body) {
|
|
20515
|
+
let value;
|
|
20516
|
+
try {
|
|
20517
|
+
value = JSON.parse(body);
|
|
20518
|
+
} catch {
|
|
20519
|
+
return { kind: "unparseable" };
|
|
20520
|
+
}
|
|
20521
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return { kind: "non-object" };
|
|
20522
|
+
return {
|
|
20523
|
+
kind: "envelope",
|
|
20524
|
+
response: value
|
|
20525
|
+
};
|
|
20526
|
+
}
|
|
20527
|
+
/**
|
|
20528
|
+
* Every field of the response is HANDLER-CONTROLLED, so each one is made safe
|
|
20529
|
+
* to render before it reaches a log line, and capped.
|
|
20530
|
+
*
|
|
20531
|
+
* Both halves are regressions this function introduced and a review caught.
|
|
20532
|
+
* The line it replaced printed `body.substring(0, 200)` -- raw WIRE json, where
|
|
20533
|
+
* the encoder had already escaped control characters as `\u001b`, and which was
|
|
20534
|
+
* capped at 200 characters by construction. Parsing first UNDOES the escaping:
|
|
20535
|
+
* an ESC and a newline reach the terminal as real bytes, so a handler (or
|
|
20536
|
+
* anyone holding the pre-signed response URL) could clear the screen and print
|
|
20537
|
+
* a forged `ERROR [cdkd]` line into a CI transcript. Measured: a
|
|
20538
|
+
* `PhysicalResourceId` carrying `ESC[2J` plus a newline rendered both. And
|
|
20539
|
+
* dropping the substring removed the bound -- a 5000-char id with 300 `Data`
|
|
20540
|
+
* keys rendered a 19,714-character line, re-emitted on EVERY poll.
|
|
20541
|
+
*
|
|
20542
|
+
* `displaySafe` is this repo's one answer to the first (issue
|
|
20543
|
+
* https://github.com/go-to-k/cdkd/issues/2170); `state.ts` already applies the
|
|
20544
|
+
* same treatment to this very value when it prints a state record.
|
|
20545
|
+
*/
|
|
20546
|
+
function capForLog(value) {
|
|
20547
|
+
const safe = displaySafe(value);
|
|
20548
|
+
const capped = safe.length > DESCRIBE_MAX_FIELD_CHARS ? `${safe.slice(0, DESCRIBE_MAX_FIELD_CHARS)}...(${safe.length} chars)` : safe;
|
|
20549
|
+
return JSON.stringify(capped);
|
|
20550
|
+
}
|
|
20551
|
+
/** Per-field cap for the poll log line. */
|
|
20552
|
+
const DESCRIBE_MAX_FIELD_CHARS = 200;
|
|
20553
|
+
/** Whole-line clamp, applied after the per-field caps. */
|
|
20554
|
+
const DESCRIBE_MAX_LINE_CHARS = 1e3;
|
|
20555
|
+
/** How many `Data` key names the poll log line names before counting the rest. */
|
|
20556
|
+
const DESCRIBE_MAX_DATA_KEYS = 20;
|
|
20557
|
+
/**
|
|
20558
|
+
* Render a NON-SENSITIVE one-line summary of a custom-resource response body
|
|
20559
|
+
* for the poll's debug log (issue #2250).
|
|
20560
|
+
*
|
|
20561
|
+
* The body is the CloudFormation custom-resource response document, and its
|
|
20562
|
+
* `Data` field is the documented place a handler returns a GENERATED VALUE —
|
|
20563
|
+
* including a generated secret. The previous log line emitted
|
|
20564
|
+
* `body.substring(0, 200)`, which put those values on the terminal (and, in
|
|
20565
|
+
* CI, into the retained build log) on every poll under `--verbose`.
|
|
20566
|
+
*
|
|
20567
|
+
* What survives here is everything the line was actually useful for: WHICH
|
|
20568
|
+
* resource answered (the caller adds the logical id), WHETHER it succeeded
|
|
20569
|
+
* (`Status`), what identity it claimed (`PhysicalResourceId` — already
|
|
20570
|
+
* persisted to state.json, so not a new channel), and WHICH keys came back
|
|
20571
|
+
* (`Object.keys(Data)`). The `Data` VALUES never appear, and neither does
|
|
20572
|
+
* `Reason`, which is free-form handler text that can quote them.
|
|
20573
|
+
*
|
|
20574
|
+
* For a body that is not a usable envelope, only its LENGTH is reported —
|
|
20575
|
+
* never its bytes. That keeps the diagnostic for the case it matters most in
|
|
20576
|
+
* (a handler writing a malformed response) without turning the fallback into
|
|
20577
|
+
* the same prefix echo through another door.
|
|
20578
|
+
*/
|
|
20579
|
+
function describeCfnResponseBody(body, parsed) {
|
|
20580
|
+
if (parsed.kind !== "envelope") return `${parsed.kind === "unparseable" ? "unparseable body" : "JSON body is not an object"} (${body.length} chars)`;
|
|
20581
|
+
const envelope = parsed.response;
|
|
20582
|
+
const status = typeof envelope["Status"] === "string" ? envelope["Status"] : "<absent>";
|
|
20583
|
+
const physicalId = typeof envelope["PhysicalResourceId"] === "string" ? envelope["PhysicalResourceId"] : "<absent>";
|
|
20584
|
+
const data = envelope["Data"];
|
|
20585
|
+
let dataPart;
|
|
20586
|
+
if (data === void 0) dataPart = "Data absent";
|
|
20587
|
+
else if (typeof data === "object" && data !== null && !Array.isArray(data)) {
|
|
20588
|
+
const keys = Object.keys(data);
|
|
20589
|
+
const shown = keys.slice(0, DESCRIBE_MAX_DATA_KEYS).map((k) => capForLog(k));
|
|
20590
|
+
const omitted = keys.length - shown.length;
|
|
20591
|
+
dataPart = `Data keys [${shown.join(", ")}${omitted > 0 ? `, +${omitted} more` : ""}]`;
|
|
20592
|
+
} else dataPart = "Data not an object";
|
|
20593
|
+
const line = `Status=${capForLog(status)} PhysicalResourceId=${capForLog(physicalId)} ${dataPart}`;
|
|
20594
|
+
return line.length > DESCRIBE_MAX_LINE_CHARS ? `${line.slice(0, DESCRIBE_MAX_LINE_CHARS)}...(${line.length} chars total)` : line;
|
|
20595
|
+
}
|
|
20596
|
+
/**
|
|
20509
20597
|
* Custom Resource Provider
|
|
20510
20598
|
*
|
|
20511
20599
|
* Implements Lambda-backed custom resources by invoking the Lambda function
|
|
@@ -21188,7 +21276,7 @@ var CustomResourceProvider = class CustomResourceProvider {
|
|
|
21188
21276
|
}
|
|
21189
21277
|
/** Truncate a CR FAILED reason for log readability. */
|
|
21190
21278
|
truncateReason(reason, max = 200) {
|
|
21191
|
-
const r = reason ?? "Unknown reason";
|
|
21279
|
+
const r = displaySafe(reason ?? "Unknown reason");
|
|
21192
21280
|
return r.length > max ? `${r.slice(0, max)}...` : r;
|
|
21193
21281
|
}
|
|
21194
21282
|
/**
|
|
@@ -21503,16 +21591,15 @@ var CustomResourceProvider = class CustomResourceProvider {
|
|
|
21503
21591
|
Key: responseKey
|
|
21504
21592
|
}))).Body?.transformToString();
|
|
21505
21593
|
if (body && body.length > 0) {
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21594
|
+
const parsed = parseCfnResponseBody(body);
|
|
21595
|
+
this.logger.debug(`Got S3 response for ${logicalId}: ${describeCfnResponseBody(body, parsed)}`);
|
|
21596
|
+
if (parsed.kind === "envelope") {
|
|
21597
|
+
const cfnResponse = parsed.response;
|
|
21509
21598
|
if (cfnResponse.Status === "SUCCESS" || cfnResponse.Status === "FAILED") {
|
|
21510
21599
|
await this.cleanupResponseObject(responseKey);
|
|
21511
21600
|
return cfnResponse;
|
|
21512
21601
|
}
|
|
21513
|
-
}
|
|
21514
|
-
this.logger.debug(`S3 response not yet valid JSON for ${logicalId}, retrying...`);
|
|
21515
|
-
}
|
|
21602
|
+
} else this.logger.debug(`S3 response not yet valid JSON for ${logicalId}, retrying...`);
|
|
21516
21603
|
}
|
|
21517
21604
|
} catch (error) {
|
|
21518
21605
|
const err = error;
|
|
@@ -30544,4 +30631,4 @@ var DeployEngine = class {
|
|
|
30544
30631
|
|
|
30545
30632
|
//#endregion
|
|
30546
30633
|
export { maskerOrIdentity as $, findLargeInlineResources as $n, TemplateParser as $t, renderStatefulReason as A, formatDockerLoginError as An, StackHasActiveImportsError as Ar, STATE_SOURCED_READBACK_RULES as At, exportAliasCollisionScrubWarning as B, getLegacyStateBucketName as Bn, isThrottlingError as Br, classifyReplaySecretRegion as Bt, isFinalSnapshotError as C, parseBootstrapMarker as Cn, LockError as Cr, configStringRefusal as Ct, extractDeploymentEventError as D, buildDenyExternalAccessPolicy as Dn, ProvisioningError as Dr, requireConfigObject as Dt, makeCanonicalizePropertiesFn as E, validateContainerRepoName as En, PartialFailureError as Er, requireConfigArray as Et, green as F, AssetManifestLoader as Fn, isCdkdError as Fr, isSingleDynamicReferenceToken as Ft, IAMRoleProvider as G, resolveStateBucketWithDefault as Gn, s3BucketRegionalDomainName as Gt, secretBearingStateKeyWarning as H, resolveAutoAssetStorage as Hn, __exportAll as Hr, s3BucketArn as Ht, red as I, getDockerImageBySourceHash as In, normalizeAwsError as Ir, maskSecretsInError as It, ProviderRegistry as J, stateBucketExistenceConfirmed as Jn, DiffCalculator as Jt, collectInlinePolicyNamesManagedBySiblings as K, resolveStateBucketWithDefaultAndSource as Kn, s3BucketWebsiteUrl as Kt, yellow as L, Synthesizer as Ln, withErrorHandling as Lr, maskSecretsInText as Lt, bold as M, partitionSensitiveEnv as Mn, StateError as Mr, createSecretMasker as Mt, cyan as N, runDockerForeground as Nn, SynthesisError as Nr, dynamicReferenceTokens as Nt, MULTI_REGION_RECREATE_BLOCKED_TYPES as O, buildDockerImage as On, ResourceTimeoutError as Or, requireConfigString as Ot, gray as P, runDockerStreaming as Pn, formatError as Pr, errorCauseChain as Pt, maskDeep as Q, MIGRATE_TMP_PREFIX as Qn, DagBuilder as Qt, collectDeclaredOutputNames as R, synthesisStatusMessage as Rn, isMarkedNonRetryable as Rr, redactSecretsForState as Rt, createPreDeleteFinalSnapshot as S, isCrossRegionRedirect as Sn, LocalStartServiceError as Sr, configBooleanRefusal as St, unsupportedFinalSnapshotError as T, validateAssetBucketName as Tn, NestedStackChildDirectDestroyError as Tr, replayWarn as Tt, stateKeySecretExposure as U, resolveCaptureObservedState as Un, s3BucketDomainName as Ut, isExportAliasCollision as V, resolveApp as Vn, markNonRetryable as Vr, producerRegionsFromState as Vt, getCurrentResourceSecrets as W, resolveSkipPrefix as Wn, s3BucketDualStackDomainName as Wt, findSilentDropProperties as X, CFN_TEMPLATE_BODY_LIMIT as Xn, describeTypeWithThrottleRetry as Xt, findActionableSilentDrops as Y, warnDeprecatedNoPrefixCliFlag as Yn, INTRINSIC_KEYS as Yt, createMaskedRetryLogger as Z, CFN_TEMPLATE_URL_LIMIT as Zn, withRetry as Zt, computeImplicitDeleteEdges as _, AssetModeResolver as _n, DependencyError as _r, WAFv2WebACLProvider as _t, DeploymentEventsStore as a, importableOutputKeys as an, AssemblyReader as ar, isInterruptedWaitError as at, buildFinalSnapshotIdentifier as b, ensureAssetStorage as bn, LocalInvokeBuildError as br, assertRegionMatch as bt, replayFailedOperations as c, AssetPublisher as cn, resolveBucketRegion as cr, slowCcOperationTimeoutMs as ct, updatePartialReason as d, buildAssetRedirectMap as dn, resetAwsClients as dr, IntrinsicFunctionResolver as dt, LockManager as en, uploadCfnTemplate as er, CUSTOM_RESOURCE_RESPONSE_PREFIX as et, UNSPECIFIED_SKIP_REASON as f, createAssetRedirectResolver as fn, setAwsClients as fr, carriesDynamicReference as ft, IMPLICIT_DELETE_DEPENDENCIES as g, stripControlChars as gn, CrossAccountSecretRefusalError as gr, refStateLookupFromResource as gt, maskingRetryLogger as h, escapeRegExp$1 as hn, ConfigError as hr, parameterTypeMayLoseSecretIdentity as ht, DeploymentEventsReader as i, exportNamesCarriedFrom as in, derivePartitionAndUrlSuffix as ir, interruptWatchListenerCount as it, formatResourceLine as j, getDockerCmd as jn, StackTerminationProtectionError as jr, TEMPLATE_SOURCED_RULES as jt, isStatefulRecreateTargetSync as k, dockerSpawnEnvWithSensitive as kn, ResourceUpdateNotSupportedError as kr, STATE_SOURCED_CROSS_GENERATION_RULES as kt, replayRollback as l, stringifyValue as ln, AwsClients as lr, disableInstanceApiTermination as lt, withResourceDeadline as m, rewriteTemplateAssetReferences as mn, CdkdError as mr, getAccountInfo as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, S3StateBackend as nn, PARTITION_TABLE as nr, beginCommandInterruptScope as nt, planFailedOps as o, importableOutputs as on, processStackMessages as or, startInterruptWatch as ot, deleteSkipReason as p, loadPublishableAssetManifest as pn, AssetError as pr, cfnRefValueFromPhysicalId as pt, clearOnUpdateRemoval as q, resolveUseCdkBootstrapAssets as qn, applyRoleArnIfSet as qt, DeployEngine as r, rebuildClientForBucketRegion as rn, canonicalizeRegion as rr, endCommandInterruptScope as rt, planRollback as s, shouldRetainResource as sn, clearBucketRegionCache as sr, CloudControlProvider as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, displaySafe as tn, expectedOwnerParam as tr, DEFAULT_STATE_PREFIX as tt, updatePartialMessage as u, WorkGraph as un, getAwsClients as ur, isTerminationProtectionPropagationError as ut, ATOMIC_FINAL_SNAPSHOT_TYPES as v, BOOTSTRAP_MARKER_PREFIX as vn, DeployCancelledError as vr, normalizeAwsTagsToCfn as vt, refusesFinalSnapshot as w, readBootstrapMarkerBody as wn, MissingCdkCliError as wr, readConfigString as wt, ccRoutedFinalSnapshotError as x, getBootstrapMarkerKey as xn, LocalMigrateError as xr, coerceCfnBoolean as xt, PRE_DELETE_SNAPSHOT_TYPES as y, assertAssetBucketRegion as yn, DynamicReferenceRegionAmbiguousError as yr, resolveExplicitPhysicalId as yt, collectPublishedOutputNames as z, getDefaultStateBucketName as zn, isRetryableTransientError as zr, scrubResourceRecord as zt };
|
|
30547
|
-
//# sourceMappingURL=deploy-engine-
|
|
30634
|
+
//# sourceMappingURL=deploy-engine-PNoV56rY.js.map
|