@go-to-k/cdkd 0.296.5 → 0.296.7
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-DhyYUns2.js → asg-provider-BU0YONBp.js} +2 -2
- package/dist/{asg-provider-DhyYUns2.js.map → asg-provider-BU0YONBp.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-Cm7z6aQk.js → deploy-engine-wyaJUA8V.js} +680 -497
- package/dist/deploy-engine-wyaJUA8V.js.map +1 -0
- package/dist/{iam-role-provider-CXGJXY5J.js → iam-role-provider-obY72uH2.js} +117 -6
- package/dist/iam-role-provider-obY72uH2.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{neptune-provider-DCgJR2NX.js → neptune-provider-C3f-vDOh.js} +2 -2
- package/dist/{neptune-provider-DCgJR2NX.js.map → neptune-provider-C3f-vDOh.js.map} +1 -1
- package/dist/{program-DPk5db_j.js → program-DEnDp4o0.js} +12 -11
- package/dist/program-DEnDp4o0.js.map +1 -0
- package/dist/{provider-classes-oZ8a4BHE.js → provider-classes-CsF7Ia5F.js} +61 -110
- package/dist/provider-classes-CsF7Ia5F.js.map +1 -0
- package/dist/{rds-provider-B0JrOskT.js → rds-provider-Cf5P2so_.js} +2 -2
- package/dist/{rds-provider-B0JrOskT.js.map → rds-provider-Cf5P2so_.js.map} +1 -1
- package/dist/{version-CjMP26Dj.js → version-LalLOhpQ.js} +2 -2
- package/dist/{version-CjMP26Dj.js.map → version-LalLOhpQ.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-Cm7z6aQk.js.map +0 -1
- package/dist/iam-role-provider-CXGJXY5J.js.map +0 -1
- package/dist/program-DPk5db_j.js.map +0 -1
- package/dist/provider-classes-oZ8a4BHE.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { r as getAwsClients, s as __exportAll } from "./aws-clients-CnmtbrxD.js"
|
|
|
2
2
|
import { A as displayIdent, C as withoutGeneratedFallbackName, D as UNRENDERABLE, E as STACK_REF_MAX_CODE_POINTS, F as plainIdentOr, I as safeMsg, M as displayStackName, N as isPasteableIdent, R as truncateCodePoints, S as withStackName, T as SECRET_REF_MAX_CODE_POINTS, _ as generateResourceNameWithFallback, b as looksLikeCdkdGeneratedName, c as installLogLineMaskerSource, g as generateResourceName, h as explicitNamePropertyFor, j as displaySafe, k as displayAwsMessage, l as getLiveRenderer, n as getLogger, p as applyDefaultNameForFallback, r as isStdoutReservedForPayload, s as currentLogLineMasker, v as getCurrentSkipPrefix, x as withSkipPrefix, y as getCurrentStackName } from "./logger-DAaB7GFO.js";
|
|
3
3
|
import { $n as markRedactedCause, $t as LockError, A as isTerminalDeleteFailure, At as CUSTOM_RESOURCE_RESPONSE_PREFIX, Bn as isAmbiguousCcHandlerErrorCode, Bt as clientDefaultsFor, C as refusalTypeShown, Cn as physicalIdShownBesideCommand, Ct as buildForceUnlockCommand, D as ProtectionFlipRegistry, Dn as shellQuote, Dt as formatLockOperation, En as shellBoundedDisplay, Et as formatLockExpiry, Fn as isRecreateRetryableError, Ft as producerRecordKey, Gn as retryClassificationText, H as pasteableAwsCommand, Hn as isIamPropagationError, Ht as AccountIdUnavailableError, In as isReplayedNameCollisionFrom, J as isInterruptedWaitError, Jn as safeStringify$1, Kn as describeAwsFailure, Kt as CrossAccountSecretRefusalError, Lt as withPasteableAwsProfile, M as observeThenDisableProtection, Mn as hasReplayMayCollide, Mt as injectiveKey, N as protectionFlipKey, Nn as isNameCollisionErrorFrom, O as compensateProtectionFlip, On as withheldTargetClause, Ot as formatLockOwner, Pn as isNameCooldownError, Q as canonicalizeRoute53QueryName, Qn as markNonRetryable, R as DELETION_PROTECTION_DOC_POINTER, Rn as markReplayMayCollide, Rt as ambientClientDefaults, S as quotedRemedyLogicalId, Sn as pasteableCommand, St as UNREPRODUCIBLE_LOCK_CLAUSE, T as resolveExplicitPhysicalId, Tn as quotedOrDescribed, U as protectedReplacementAdvice, Un as isRetryableTransientError, Ut as AssetError, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, Wn as isTransientServerError, Wt as CdkdError, X as ElapsedBudgetRegistry, Xn as isMarkedNonRetryable, Xt as IntrinsicResolutionRefusalError, Y as startInterruptWatch, Yt as DynamicReferenceRegionAmbiguousError, Z as monotonicNowMs, Zn as isThrottlingError, _n as SHELL_ACTIVE_WHY, _t as hasCreatedBeforeFailure, an as ResourceTimeoutError, at as segmentAfterAnchor, b as isQuotableImportValue, bt as markAuxiliaryFailure, ct as createMaskedRetryLogger, d as prepareRemovalForUpdate, dt as maskerOrIdentity, en as MacroExpansionError, er as wrapMaskedAwsError, et as compositeIdSeparatorRefusal, f as removalWarning, ft as withDerivedNameMasks, g as assertRegionMatch, gn as SHELL_ACTIVE, gt as createdBeforeFailure, h as RESOURCE_NOT_FOUND, i as holdsSecretDerivedEntry, in as ProvisioningError, it as resourceTypeShown, jn as isUpdateUnsupportedError, jt as DEFAULT_STATE_PREFIX, k as deleteWithProtectionCompensation, kt as sanitizeRecoveryValue, l as withUnchangedSecretPrincipalLists, ln as StateError, lt as isSecretDerivedValue, m as withoutInjectedRemovals, mt as carryCreatedBeforeFailure, nt as logicalIdShown, on as ResourceUpdateNotSupportedError, ot as stateOrphanRecordRemedy, pn as normalizeAwsError, pt as RETRY_AUXILIARY_OWNER, qt as DependencyError, st as createMaskedLogSinks, tn as MalformedProducerRecordRefusalError, un as SynthesisError, ut as maskDeep, vn as UNSHOWABLE_VALUE, vt as isAuxiliaryFailure, wn as plainOrDescribed, x as normalizeAwsTagsToCfn, xn as isInertUnquoted, xt as markCreatedBeforeFailure, yn as commandHole, yt as isAuxiliaryMarkOf, zn as formatRetryClassificationSignals, zt as ambientCredentialConfig } from "./iam-policy-targets-td1X_kKN.js";
|
|
4
4
|
import { a as setAssumedRoleCredentials, i as getPreAssumeEnvCredentials, n as awsClientDefaults, o as setPreAssumeEnvCredentials, r as getAssumedRoleCredentials, s as ambientRegion, t as SECOND_ROLE_PUBLISH_REFUSAL } from "./aws-client-defaults-D0q0z4dG.js";
|
|
5
|
-
import { t as getCdkdVersion } from "./version-
|
|
5
|
+
import { t as getCdkdVersion } from "./version-LalLOhpQ.js";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
8
|
import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetBucketReplicationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -6822,6 +6822,330 @@ function positionListByCrossStackSource(bag, source, secrets) {
|
|
|
6822
6822
|
return certifiedListForLeaf(secrets, association, bag);
|
|
6823
6823
|
}
|
|
6824
6824
|
|
|
6825
|
+
//#endregion
|
|
6826
|
+
//#region src/deployment/secret-redaction/fresh-noecho.ts
|
|
6827
|
+
function embedsFreshNoEchoValue(text, secrets) {
|
|
6828
|
+
const fresh = freshNoEchoValuesOf.get(secrets);
|
|
6829
|
+
if (fresh === void 0) return false;
|
|
6830
|
+
for (const value of fresh) if (isMaskOnlyPlaintext(secrets, value) && text.includes(value)) return true;
|
|
6831
|
+
return false;
|
|
6832
|
+
}
|
|
6833
|
+
function carriesFreshNoEchoValue(value, secrets) {
|
|
6834
|
+
const isFresh = freshNoEchoLeafTest(secrets);
|
|
6835
|
+
if (isFresh === void 0) return false;
|
|
6836
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6837
|
+
const walk = (node) => {
|
|
6838
|
+
if (typeof node === "string") return isFresh(node);
|
|
6839
|
+
if (node === null || typeof node !== "object") return false;
|
|
6840
|
+
if (seen.has(node)) return false;
|
|
6841
|
+
seen.add(node);
|
|
6842
|
+
if (Array.isArray(node)) return node.some((item) => walk(item));
|
|
6843
|
+
return Object.values(node).some((child) => walk(child));
|
|
6844
|
+
};
|
|
6845
|
+
return walk(value);
|
|
6846
|
+
}
|
|
6847
|
+
function freshNoEchoLeafPositions(value, secrets) {
|
|
6848
|
+
const isFresh = freshNoEchoLeafTest(secrets);
|
|
6849
|
+
if (isFresh === void 0) return [];
|
|
6850
|
+
const leaves = [];
|
|
6851
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
6852
|
+
const walk = (node, path) => {
|
|
6853
|
+
if (typeof node === "string") {
|
|
6854
|
+
if (isFresh(node)) leaves.push({
|
|
6855
|
+
path,
|
|
6856
|
+
plaintext: node
|
|
6857
|
+
});
|
|
6858
|
+
return;
|
|
6859
|
+
}
|
|
6860
|
+
if (node === null || typeof node !== "object") return;
|
|
6861
|
+
if (ancestors.has(node)) return;
|
|
6862
|
+
ancestors.add(node);
|
|
6863
|
+
if (Array.isArray(node)) node.forEach((item, index) => walk(item, [...path, index]));
|
|
6864
|
+
else for (const [key, child] of Object.entries(node)) walk(child, [...path, key]);
|
|
6865
|
+
ancestors.delete(node);
|
|
6866
|
+
};
|
|
6867
|
+
walk(value, []);
|
|
6868
|
+
return leaves;
|
|
6869
|
+
}
|
|
6870
|
+
function freshNoEchoLeafTest(secrets) {
|
|
6871
|
+
const fresh = freshNoEchoValuesOf.get(secrets);
|
|
6872
|
+
if (fresh === void 0 || fresh.size === 0) return void 0;
|
|
6873
|
+
const needles = containmentNeedlesOf(secrets).filter((needle) => fresh.has(needle));
|
|
6874
|
+
return (leaf) => fresh.has(leaf) && isMaskOnlyPlaintext(secrets, leaf) || leaf !== "***" && embedsNeedleOutsideReferences(leaf, needles, secrets);
|
|
6875
|
+
}
|
|
6876
|
+
function containmentNeedlesOf(secrets) {
|
|
6877
|
+
const values = containmentValuesOf.get(secrets);
|
|
6878
|
+
if (values === void 0 || values.size === 0) return [];
|
|
6879
|
+
const needles = [];
|
|
6880
|
+
for (const value of values) if (value.length >= 4 && isMaskOnlyPlaintext(secrets, value)) needles.push(value);
|
|
6881
|
+
return needles;
|
|
6882
|
+
}
|
|
6883
|
+
function isStrictlyInsideASpan(spans, start, end) {
|
|
6884
|
+
return spans.some((span) => span.start <= start && end <= span.end && (span.start !== start || span.end !== end));
|
|
6885
|
+
}
|
|
6886
|
+
function embedsNeedleOutsideReferences(leaf, needles, secrets) {
|
|
6887
|
+
let spans;
|
|
6888
|
+
for (const needle of needles) for (let at = leaf.indexOf(needle); at >= 0; at = leaf.indexOf(needle, at + 1)) {
|
|
6889
|
+
spans ??= isDynamicReferenceString(leaf) ? resolvableReferenceSpans(leaf, new Set(secrets.values())) : [];
|
|
6890
|
+
if (!isStrictlyInsideASpan(spans, at, at + needle.length)) return true;
|
|
6891
|
+
}
|
|
6892
|
+
return false;
|
|
6893
|
+
}
|
|
6894
|
+
function flattenEmbeddedNoEchoLeaves(value, secrets) {
|
|
6895
|
+
const needles = containmentNeedlesOf(secrets);
|
|
6896
|
+
if (needles.length === 0) return value;
|
|
6897
|
+
const flattens = (leaf) => leaf !== "***" && embedsNeedleOutsideReferences(leaf, needles, secrets);
|
|
6898
|
+
const walk = (node) => {
|
|
6899
|
+
if (typeof node === "string") return flattens(node) ? "***" : node;
|
|
6900
|
+
if (node === null || typeof node !== "object") return node;
|
|
6901
|
+
if (Array.isArray(node)) {
|
|
6902
|
+
let changed = false;
|
|
6903
|
+
const out = node.map((item) => {
|
|
6904
|
+
const next = walk(item);
|
|
6905
|
+
if (next !== item) changed = true;
|
|
6906
|
+
return next;
|
|
6907
|
+
});
|
|
6908
|
+
return changed ? out : node;
|
|
6909
|
+
}
|
|
6910
|
+
if (isOrdinaryDate(node)) {
|
|
6911
|
+
const persisted = node.toJSON();
|
|
6912
|
+
return typeof persisted === "string" && flattens(persisted) ? "***" : node;
|
|
6913
|
+
}
|
|
6914
|
+
let out;
|
|
6915
|
+
for (const [key, child] of Object.entries(node)) {
|
|
6916
|
+
const next = walk(child);
|
|
6917
|
+
if (next === child) continue;
|
|
6918
|
+
out ??= Object.assign(Object.create(null), node);
|
|
6919
|
+
out[key] = next;
|
|
6920
|
+
}
|
|
6921
|
+
return out ?? node;
|
|
6922
|
+
};
|
|
6923
|
+
return walk(value);
|
|
6924
|
+
}
|
|
6925
|
+
function substringNeedlesOf(secrets) {
|
|
6926
|
+
const needles = [];
|
|
6927
|
+
for (const plaintext of secrets.keys()) if (!isMaskOnlyPlaintext(secrets, plaintext)) needles.push(plaintext);
|
|
6928
|
+
return needles;
|
|
6929
|
+
}
|
|
6930
|
+
function recordedExpressionsOf(secrets) {
|
|
6931
|
+
const expressions = /* @__PURE__ */ new Set();
|
|
6932
|
+
for (const [plaintext, expression] of secrets) if (!isMaskOnlyPlaintext(secrets, plaintext)) expressions.add(expression);
|
|
6933
|
+
return expressions;
|
|
6934
|
+
}
|
|
6935
|
+
const recoverableMaskedOutputs = /* @__PURE__ */ new Map();
|
|
6936
|
+
function maskedOutputKey(identity, stackName, region, outputKey) {
|
|
6937
|
+
return `${identity}\u0000${stackName}\u0000${region}\u0000${outputKey}`;
|
|
6938
|
+
}
|
|
6939
|
+
function recordRecoverableMaskedOutput(identity, stackName, region, outputKey, plaintext) {
|
|
6940
|
+
recoverableMaskedOutputs.set(maskedOutputKey(identity, stackName, region, outputKey), plaintext);
|
|
6941
|
+
}
|
|
6942
|
+
function recoverMaskedOutput(identity, stackName, region, outputKey) {
|
|
6943
|
+
return recoverableMaskedOutputs.get(maskedOutputKey(identity, stackName, region, outputKey));
|
|
6944
|
+
}
|
|
6945
|
+
|
|
6946
|
+
//#endregion
|
|
6947
|
+
//#region src/deployment/secret-redaction/nested-stack.ts
|
|
6948
|
+
const NESTED_STACK_RESOURCE_TYPE$4 = "AWS::CloudFormation::Stack";
|
|
6949
|
+
const nestedStackParameterExpressions = /* @__PURE__ */ new WeakMap();
|
|
6950
|
+
const UNFRAMED_SPELLING = Symbol("cdkd.nested-parameter.unframed-spelling");
|
|
6951
|
+
function recordNestedStackParameterExpressions(secrets, resourceType, resolvedProperties, sourceProperties, rules = TEMPLATE_DERIVED_RULES) {
|
|
6952
|
+
if (resourceType !== NESTED_STACK_RESOURCE_TYPE$4) return;
|
|
6953
|
+
if (secrets.size === 0) return;
|
|
6954
|
+
if (!isPlainObject$4(resolvedProperties) || !isPlainObject$4(sourceProperties)) return;
|
|
6955
|
+
if (!Object.hasOwn(resolvedProperties, "Parameters")) return;
|
|
6956
|
+
if (!Object.hasOwn(sourceProperties, "Parameters")) return;
|
|
6957
|
+
const resolvedParameters = resolvedProperties["Parameters"];
|
|
6958
|
+
const sourceParameters = sourceProperties["Parameters"];
|
|
6959
|
+
if (!isPlainObject$4(resolvedParameters) || !isPlainObject$4(sourceParameters)) return;
|
|
6960
|
+
const positioned = redactSecretsForState(markSameGenerationBag({ ...resolvedParameters }), secrets, sourceParameters, rules);
|
|
6961
|
+
let table = nestedStackParameterExpressions.get(secrets);
|
|
6962
|
+
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
6963
|
+
if (typeof resolvedValue !== "string" || !secrets.has(resolvedValue)) continue;
|
|
6964
|
+
const expression = positioned[name];
|
|
6965
|
+
if (typeof expression !== "string") continue;
|
|
6966
|
+
if (!isSingleDynamicReferenceToken(expression)) continue;
|
|
6967
|
+
const sourceLeaf = sourceParameters[name];
|
|
6968
|
+
if (typeof sourceLeaf === "string" && expression !== sourceLeaf) continue;
|
|
6969
|
+
if (expression === resolvedValue) continue;
|
|
6970
|
+
const seenResolvingTo = plaintextIndexOf(secrets).get(expression);
|
|
6971
|
+
if (seenResolvingTo !== void 0 && seenResolvingTo !== resolvedValue) continue;
|
|
6972
|
+
if (typeof sourceLeaf === "string" && resolvedPlaintextOf(secrets, expression) !== resolvedValue) continue;
|
|
6973
|
+
if (table === void 0) {
|
|
6974
|
+
table = /* @__PURE__ */ new Map();
|
|
6975
|
+
nestedStackParameterExpressions.set(secrets, table);
|
|
6976
|
+
}
|
|
6977
|
+
storeAssociation(table, name, expression, resolvedValue);
|
|
6978
|
+
}
|
|
6979
|
+
const framesByValue = /* @__PURE__ */ new Map();
|
|
6980
|
+
const tokensOf = /* @__PURE__ */ new Map();
|
|
6981
|
+
const frameSpellings = /* @__PURE__ */ new Map();
|
|
6982
|
+
const frameSpellingOf = (name) => {
|
|
6983
|
+
if (!frameSpellings.has(name)) frameSpellings.set(name, computeFrameSpelling(name));
|
|
6984
|
+
return frameSpellings.get(name);
|
|
6985
|
+
};
|
|
6986
|
+
const computeFrameSpelling = (name) => {
|
|
6987
|
+
const resolvedValue = resolvedParameters[name];
|
|
6988
|
+
if (typeof resolvedValue !== "string") return void 0;
|
|
6989
|
+
const sourceLeaf = sourceParameters[name];
|
|
6990
|
+
if (typeof sourceLeaf === "string") return sourceLeaf;
|
|
6991
|
+
if (!isPlainObject$4(sourceLeaf)) return void 0;
|
|
6992
|
+
const written = positioned[name];
|
|
6993
|
+
if (typeof written !== "string") return void 0;
|
|
6994
|
+
const rendered = intrinsicSkeletonSegments(sourceLeaf)?.map((s) => s === UNKNOWN_PART ? "\0" : s).join("");
|
|
6995
|
+
const spans = rendered === void 0 ? [] : dynamicReferenceSpans(rendered);
|
|
6996
|
+
if (rendered !== void 0 && spans.length === 1) {
|
|
6997
|
+
const [span] = spans;
|
|
6998
|
+
const ownToken = rendered.slice(span.start, span.end);
|
|
6999
|
+
if (written !== resolvedValue && SPELLED_SECRET_REFERENCE_PREFIXES.some((prefix) => ownToken.startsWith(prefix))) return written;
|
|
7000
|
+
}
|
|
7001
|
+
const substituted = substitutedSpellingOf(secrets, sourceLeaf, resolvedValue);
|
|
7002
|
+
if (substituted === void 0) return void 0;
|
|
7003
|
+
return written === resolvedValue || written === substituted ? substituted : void 0;
|
|
7004
|
+
};
|
|
7005
|
+
const certifiedSpellingOf = (name) => {
|
|
7006
|
+
const sourceLeaf = sourceParameters[name];
|
|
7007
|
+
if (typeof sourceLeaf === "string") return positioned[name] === sourceLeaf ? sourceLeaf : void 0;
|
|
7008
|
+
return frameSpellingOf(name);
|
|
7009
|
+
};
|
|
7010
|
+
const unwrittenValues = /* @__PURE__ */ new Set();
|
|
7011
|
+
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
7012
|
+
if (typeof resolvedValue !== "string") continue;
|
|
7013
|
+
const spelling = frameSpellingOf(name);
|
|
7014
|
+
const frame = spelling === void 0 ? void 0 : singleSpanFrame(resolvedValue, spelling);
|
|
7015
|
+
const frames = framesByValue.get(resolvedValue) ?? /* @__PURE__ */ new Set();
|
|
7016
|
+
const unframed = frame === void 0 || resolvedPlaintextOf(secrets, frame.token) !== frame.middle;
|
|
7017
|
+
frames.add(unframed ? UNFRAMED_SPELLING : `${frame.prefix.length}:${frame.prefix}${frame.suffix}`);
|
|
7018
|
+
framesByValue.set(resolvedValue, frames);
|
|
7019
|
+
if (!unframed) {
|
|
7020
|
+
const tokens = tokensOf.get(resolvedValue) ?? /* @__PURE__ */ new Set();
|
|
7021
|
+
tokens.add(frame.token);
|
|
7022
|
+
tokensOf.set(resolvedValue, tokens);
|
|
7023
|
+
if (typeof sourceParameters[name] !== "string" && positioned[name] !== spelling) unwrittenValues.add(resolvedValue);
|
|
7024
|
+
}
|
|
7025
|
+
}
|
|
7026
|
+
for (const value of unwrittenValues) if (tokensOf.get(value)?.size !== 1) framesByValue.get(value)?.add(UNFRAMED_SPELLING);
|
|
7027
|
+
const rowWithoutParameters = {};
|
|
7028
|
+
for (const [key, value] of Object.entries(resolvedProperties)) if (key !== "Parameters") rowWithoutParameters[key] = value;
|
|
7029
|
+
const outsideLeaves = wholeStringLeavesOf(rowWithoutParameters);
|
|
7030
|
+
const framed = /* @__PURE__ */ new Map();
|
|
7031
|
+
const framedByName = [];
|
|
7032
|
+
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
7033
|
+
if (typeof resolvedValue !== "string") continue;
|
|
7034
|
+
const spelling = certifiedSpellingOf(name);
|
|
7035
|
+
if (spelling === void 0) continue;
|
|
7036
|
+
if (redactSecretsForState(resolvedValue, secrets) !== resolvedValue) continue;
|
|
7037
|
+
const frame = singleSpanFrame(resolvedValue, spelling);
|
|
7038
|
+
if (frame === void 0 || resolvedPlaintextOf(secrets, frame.token) !== frame.middle) continue;
|
|
7039
|
+
if (framesByValue.get(resolvedValue)?.size !== 1) continue;
|
|
7040
|
+
const isNeedle = resolvedValue.length >= 4;
|
|
7041
|
+
const rewrites = (leaf) => leaf === resolvedValue || isNeedle && leaf.includes(resolvedValue);
|
|
7042
|
+
let embedded = false;
|
|
7043
|
+
for (const leaf of outsideLeaves) if (rewrites(leaf)) {
|
|
7044
|
+
embedded = true;
|
|
7045
|
+
break;
|
|
7046
|
+
}
|
|
7047
|
+
for (const other of Object.values(resolvedParameters)) {
|
|
7048
|
+
if (embedded) break;
|
|
7049
|
+
if (typeof other === "string") {
|
|
7050
|
+
if (other !== resolvedValue && rewrites(other)) embedded = true;
|
|
7051
|
+
continue;
|
|
7052
|
+
}
|
|
7053
|
+
for (const leaf of wholeStringLeavesOf(other)) if (rewrites(leaf)) {
|
|
7054
|
+
embedded = true;
|
|
7055
|
+
break;
|
|
7056
|
+
}
|
|
7057
|
+
}
|
|
7058
|
+
if (embedded) continue;
|
|
7059
|
+
framedByName.push([
|
|
7060
|
+
name,
|
|
7061
|
+
spelling,
|
|
7062
|
+
resolvedValue
|
|
7063
|
+
]);
|
|
7064
|
+
if (secrets.get(frame.middle) !== frame.token && tokensOf.get(resolvedValue)?.size !== 1) continue;
|
|
7065
|
+
framed.set(resolvedValue, spelling);
|
|
7066
|
+
}
|
|
7067
|
+
for (const [plaintext, expression] of framed) secrets.set(plaintext, expression);
|
|
7068
|
+
for (const [name, expression, plaintext] of framedByName) {
|
|
7069
|
+
if (table === void 0) {
|
|
7070
|
+
table = /* @__PURE__ */ new Map();
|
|
7071
|
+
nestedStackParameterExpressions.set(secrets, table);
|
|
7072
|
+
}
|
|
7073
|
+
storeAssociation(table, name, expression, plaintext);
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
function inheritNestedStackParameterAssociations(childSecrets, parentSecrets) {
|
|
7077
|
+
const table = nestedStackParameterExpressions.get(parentSecrets);
|
|
7078
|
+
if (table === void 0 || table.size === 0) return;
|
|
7079
|
+
let associations = crossStackAssociations.get(childSecrets);
|
|
7080
|
+
for (const [name, association] of table) {
|
|
7081
|
+
const key = crossStackSourceKey({ Ref: name });
|
|
7082
|
+
if (key === void 0) continue;
|
|
7083
|
+
if (associations === void 0) {
|
|
7084
|
+
associations = /* @__PURE__ */ new Map();
|
|
7085
|
+
crossStackAssociations.set(childSecrets, associations);
|
|
7086
|
+
}
|
|
7087
|
+
if (typeof association === "symbol") {
|
|
7088
|
+
associations.set(key, association);
|
|
7089
|
+
continue;
|
|
7090
|
+
}
|
|
7091
|
+
storeAssociation(associations, key, association.expression, association.plaintext);
|
|
7092
|
+
}
|
|
7093
|
+
}
|
|
7094
|
+
function inheritedParameterExpression(parentSecrets, parameterName, resolvedValue) {
|
|
7095
|
+
const association = nestedStackParameterExpressions.get(parentSecrets)?.get(parameterName);
|
|
7096
|
+
if (association === void 0 || typeof association === "symbol") return void 0;
|
|
7097
|
+
if (Array.isArray(resolvedValue)) return certifiedListForLeaf(parentSecrets, association, resolvedValue);
|
|
7098
|
+
return certifiedExpressionForLeaf(parentSecrets, association, resolvedValue);
|
|
7099
|
+
}
|
|
7100
|
+
const inheritedParameterReads = /* @__PURE__ */ new WeakMap();
|
|
7101
|
+
const POISONED_PARAMETER_READS = Symbol("cdkd.inherited-parameter-reads.poisoned");
|
|
7102
|
+
function recordInheritedParameterRead(childSecrets, parentSecrets, parameterName) {
|
|
7103
|
+
const reads = inheritedParameterReads.get(childSecrets);
|
|
7104
|
+
if (reads === void 0) {
|
|
7105
|
+
inheritedParameterReads.set(childSecrets, {
|
|
7106
|
+
parent: parentSecrets,
|
|
7107
|
+
names: /* @__PURE__ */ new Set([parameterName])
|
|
7108
|
+
});
|
|
7109
|
+
return;
|
|
7110
|
+
}
|
|
7111
|
+
if (typeof reads === "symbol") return;
|
|
7112
|
+
if (reads.parent !== parentSecrets) {
|
|
7113
|
+
inheritedParameterReads.set(childSecrets, POISONED_PARAMETER_READS);
|
|
7114
|
+
return;
|
|
7115
|
+
}
|
|
7116
|
+
reads.names.add(parameterName);
|
|
7117
|
+
}
|
|
7118
|
+
function redactInheritedParameterValue(parentSecrets, parameterName, value) {
|
|
7119
|
+
return inheritedParameterExpression(parentSecrets, parameterName, value) ?? redactSecretsForState(value, parentSecrets);
|
|
7120
|
+
}
|
|
7121
|
+
function positionByInheritedParameter(bag, source, secrets) {
|
|
7122
|
+
const keys = Object.keys(source);
|
|
7123
|
+
if (keys.length !== 1 || keys[0] !== "Ref") return void 0;
|
|
7124
|
+
const name = source["Ref"];
|
|
7125
|
+
if (typeof name !== "string") return void 0;
|
|
7126
|
+
const reads = inheritedParameterReads.get(secrets);
|
|
7127
|
+
if (reads === void 0 || typeof reads === "symbol" || !reads.names.has(name)) return;
|
|
7128
|
+
if (typeof bag !== "string" && !Array.isArray(bag)) return void 0;
|
|
7129
|
+
if (carriesChildOnlyPlaintext(bag, secrets, reads.parent)) return void 0;
|
|
7130
|
+
const answer = redactInheritedParameterValue(reads.parent, name, bag);
|
|
7131
|
+
if (!deepEqualJsonValue(redactSecretsForState(answer, secrets), answer)) return void 0;
|
|
7132
|
+
return answer;
|
|
7133
|
+
}
|
|
7134
|
+
function carriesChildOnlyPlaintext(value, childSecrets, parentSecrets) {
|
|
7135
|
+
const parentNeedles = new Set(substringNeedlesOf(parentSecrets));
|
|
7136
|
+
const childNeedles = new Set(substringNeedlesOf(childSecrets));
|
|
7137
|
+
const childOnly = [...childSecrets.keys()].filter((plaintext) => plaintext !== "" && (!parentSecrets.has(plaintext) || childNeedles.has(plaintext) && !parentNeedles.has(plaintext)));
|
|
7138
|
+
for (const needle of parentNeedles) if (needle.length >= 4 && !childSecrets.has(needle)) childOnly.push(needle);
|
|
7139
|
+
if (childOnly.length === 0) return false;
|
|
7140
|
+
const visit = (node) => {
|
|
7141
|
+
if (typeof node === "string") return childOnly.some((plaintext) => node.includes(plaintext));
|
|
7142
|
+
if (Array.isArray(node)) return node.some(visit);
|
|
7143
|
+
if (node !== null && typeof node === "object") return Object.values(node).some(visit);
|
|
7144
|
+
return false;
|
|
7145
|
+
};
|
|
7146
|
+
return visit(value);
|
|
7147
|
+
}
|
|
7148
|
+
|
|
6825
7149
|
//#endregion
|
|
6826
7150
|
//#region src/deployment/secret-redaction/redact-path.ts
|
|
6827
7151
|
function redactByPath(bag, source, secrets, rules, secretExpressions, bagIsSameGeneration) {
|
|
@@ -6835,6 +7159,10 @@ function redactByPath(bag, source, secrets, rules, secretExpressions, bagIsSameG
|
|
|
6835
7159
|
}
|
|
6836
7160
|
return positionByEmbeddedSpan(bag, source, secrets, bagIsSameGeneration);
|
|
6837
7161
|
}
|
|
7162
|
+
if ((typeof bag === "string" || Array.isArray(bag)) && isPlainObject$4(source)) {
|
|
7163
|
+
const inherited = positionByInheritedParameter(bag, source, secrets);
|
|
7164
|
+
if (inherited !== void 0) return inherited;
|
|
7165
|
+
}
|
|
6838
7166
|
if (typeof bag === "string" && isPlainObject$4(source)) {
|
|
6839
7167
|
const certified = positionByCrossStackSource(bag, source, secrets);
|
|
6840
7168
|
if (certified !== void 0) return certified;
|
|
@@ -7189,127 +7517,6 @@ function deriveReadbackNeedles(bag, source, secrets, rules) {
|
|
|
7189
7517
|
};
|
|
7190
7518
|
}
|
|
7191
7519
|
|
|
7192
|
-
//#endregion
|
|
7193
|
-
//#region src/deployment/secret-redaction/fresh-noecho.ts
|
|
7194
|
-
function embedsFreshNoEchoValue(text, secrets) {
|
|
7195
|
-
const fresh = freshNoEchoValuesOf.get(secrets);
|
|
7196
|
-
if (fresh === void 0) return false;
|
|
7197
|
-
for (const value of fresh) if (isMaskOnlyPlaintext(secrets, value) && text.includes(value)) return true;
|
|
7198
|
-
return false;
|
|
7199
|
-
}
|
|
7200
|
-
function carriesFreshNoEchoValue(value, secrets) {
|
|
7201
|
-
const isFresh = freshNoEchoLeafTest(secrets);
|
|
7202
|
-
if (isFresh === void 0) return false;
|
|
7203
|
-
const seen = /* @__PURE__ */ new Set();
|
|
7204
|
-
const walk = (node) => {
|
|
7205
|
-
if (typeof node === "string") return isFresh(node);
|
|
7206
|
-
if (node === null || typeof node !== "object") return false;
|
|
7207
|
-
if (seen.has(node)) return false;
|
|
7208
|
-
seen.add(node);
|
|
7209
|
-
if (Array.isArray(node)) return node.some((item) => walk(item));
|
|
7210
|
-
return Object.values(node).some((child) => walk(child));
|
|
7211
|
-
};
|
|
7212
|
-
return walk(value);
|
|
7213
|
-
}
|
|
7214
|
-
function freshNoEchoLeafPositions(value, secrets) {
|
|
7215
|
-
const isFresh = freshNoEchoLeafTest(secrets);
|
|
7216
|
-
if (isFresh === void 0) return [];
|
|
7217
|
-
const leaves = [];
|
|
7218
|
-
const ancestors = /* @__PURE__ */ new Set();
|
|
7219
|
-
const walk = (node, path) => {
|
|
7220
|
-
if (typeof node === "string") {
|
|
7221
|
-
if (isFresh(node)) leaves.push({
|
|
7222
|
-
path,
|
|
7223
|
-
plaintext: node
|
|
7224
|
-
});
|
|
7225
|
-
return;
|
|
7226
|
-
}
|
|
7227
|
-
if (node === null || typeof node !== "object") return;
|
|
7228
|
-
if (ancestors.has(node)) return;
|
|
7229
|
-
ancestors.add(node);
|
|
7230
|
-
if (Array.isArray(node)) node.forEach((item, index) => walk(item, [...path, index]));
|
|
7231
|
-
else for (const [key, child] of Object.entries(node)) walk(child, [...path, key]);
|
|
7232
|
-
ancestors.delete(node);
|
|
7233
|
-
};
|
|
7234
|
-
walk(value, []);
|
|
7235
|
-
return leaves;
|
|
7236
|
-
}
|
|
7237
|
-
function freshNoEchoLeafTest(secrets) {
|
|
7238
|
-
const fresh = freshNoEchoValuesOf.get(secrets);
|
|
7239
|
-
if (fresh === void 0 || fresh.size === 0) return void 0;
|
|
7240
|
-
const needles = containmentNeedlesOf(secrets).filter((needle) => fresh.has(needle));
|
|
7241
|
-
return (leaf) => fresh.has(leaf) && isMaskOnlyPlaintext(secrets, leaf) || leaf !== "***" && embedsNeedleOutsideReferences(leaf, needles, secrets);
|
|
7242
|
-
}
|
|
7243
|
-
function containmentNeedlesOf(secrets) {
|
|
7244
|
-
const values = containmentValuesOf.get(secrets);
|
|
7245
|
-
if (values === void 0 || values.size === 0) return [];
|
|
7246
|
-
const needles = [];
|
|
7247
|
-
for (const value of values) if (value.length >= 4 && isMaskOnlyPlaintext(secrets, value)) needles.push(value);
|
|
7248
|
-
return needles;
|
|
7249
|
-
}
|
|
7250
|
-
function isStrictlyInsideASpan(spans, start, end) {
|
|
7251
|
-
return spans.some((span) => span.start <= start && end <= span.end && (span.start !== start || span.end !== end));
|
|
7252
|
-
}
|
|
7253
|
-
function embedsNeedleOutsideReferences(leaf, needles, secrets) {
|
|
7254
|
-
let spans;
|
|
7255
|
-
for (const needle of needles) for (let at = leaf.indexOf(needle); at >= 0; at = leaf.indexOf(needle, at + 1)) {
|
|
7256
|
-
spans ??= isDynamicReferenceString(leaf) ? resolvableReferenceSpans(leaf, new Set(secrets.values())) : [];
|
|
7257
|
-
if (!isStrictlyInsideASpan(spans, at, at + needle.length)) return true;
|
|
7258
|
-
}
|
|
7259
|
-
return false;
|
|
7260
|
-
}
|
|
7261
|
-
function flattenEmbeddedNoEchoLeaves(value, secrets) {
|
|
7262
|
-
const needles = containmentNeedlesOf(secrets);
|
|
7263
|
-
if (needles.length === 0) return value;
|
|
7264
|
-
const flattens = (leaf) => leaf !== "***" && embedsNeedleOutsideReferences(leaf, needles, secrets);
|
|
7265
|
-
const walk = (node) => {
|
|
7266
|
-
if (typeof node === "string") return flattens(node) ? "***" : node;
|
|
7267
|
-
if (node === null || typeof node !== "object") return node;
|
|
7268
|
-
if (Array.isArray(node)) {
|
|
7269
|
-
let changed = false;
|
|
7270
|
-
const out = node.map((item) => {
|
|
7271
|
-
const next = walk(item);
|
|
7272
|
-
if (next !== item) changed = true;
|
|
7273
|
-
return next;
|
|
7274
|
-
});
|
|
7275
|
-
return changed ? out : node;
|
|
7276
|
-
}
|
|
7277
|
-
if (isOrdinaryDate(node)) {
|
|
7278
|
-
const persisted = node.toJSON();
|
|
7279
|
-
return typeof persisted === "string" && flattens(persisted) ? "***" : node;
|
|
7280
|
-
}
|
|
7281
|
-
let out;
|
|
7282
|
-
for (const [key, child] of Object.entries(node)) {
|
|
7283
|
-
const next = walk(child);
|
|
7284
|
-
if (next === child) continue;
|
|
7285
|
-
out ??= Object.assign(Object.create(null), node);
|
|
7286
|
-
out[key] = next;
|
|
7287
|
-
}
|
|
7288
|
-
return out ?? node;
|
|
7289
|
-
};
|
|
7290
|
-
return walk(value);
|
|
7291
|
-
}
|
|
7292
|
-
function substringNeedlesOf(secrets) {
|
|
7293
|
-
const needles = [];
|
|
7294
|
-
for (const plaintext of secrets.keys()) if (!isMaskOnlyPlaintext(secrets, plaintext)) needles.push(plaintext);
|
|
7295
|
-
return needles;
|
|
7296
|
-
}
|
|
7297
|
-
function recordedExpressionsOf(secrets) {
|
|
7298
|
-
const expressions = /* @__PURE__ */ new Set();
|
|
7299
|
-
for (const [plaintext, expression] of secrets) if (!isMaskOnlyPlaintext(secrets, plaintext)) expressions.add(expression);
|
|
7300
|
-
return expressions;
|
|
7301
|
-
}
|
|
7302
|
-
const recoverableMaskedOutputs = /* @__PURE__ */ new Map();
|
|
7303
|
-
function maskedOutputKey(identity, stackName, region, outputKey) {
|
|
7304
|
-
return `${identity}\u0000${stackName}\u0000${region}\u0000${outputKey}`;
|
|
7305
|
-
}
|
|
7306
|
-
function recordRecoverableMaskedOutput(identity, stackName, region, outputKey, plaintext) {
|
|
7307
|
-
recoverableMaskedOutputs.set(maskedOutputKey(identity, stackName, region, outputKey), plaintext);
|
|
7308
|
-
}
|
|
7309
|
-
function recoverMaskedOutput(identity, stackName, region, outputKey) {
|
|
7310
|
-
return recoverableMaskedOutputs.get(maskedOutputKey(identity, stackName, region, outputKey));
|
|
7311
|
-
}
|
|
7312
|
-
|
|
7313
7520
|
//#endregion
|
|
7314
7521
|
//#region src/deployment/secret-redaction/redact-state.ts
|
|
7315
7522
|
function redactSecretsForState(bag, secrets, source, rules = TEMPLATE_DERIVED_RULES) {
|
|
@@ -8023,161 +8230,6 @@ function hasMaskableValues(secrets) {
|
|
|
8023
8230
|
return logOnly !== void 0 && logOnly.size > 0;
|
|
8024
8231
|
}
|
|
8025
8232
|
|
|
8026
|
-
//#endregion
|
|
8027
|
-
//#region src/deployment/secret-redaction/nested-stack.ts
|
|
8028
|
-
const NESTED_STACK_RESOURCE_TYPE$4 = "AWS::CloudFormation::Stack";
|
|
8029
|
-
const nestedStackParameterExpressions = /* @__PURE__ */ new WeakMap();
|
|
8030
|
-
const UNFRAMED_SPELLING = Symbol("cdkd.nested-parameter.unframed-spelling");
|
|
8031
|
-
function recordNestedStackParameterExpressions(secrets, resourceType, resolvedProperties, sourceProperties, rules = TEMPLATE_DERIVED_RULES) {
|
|
8032
|
-
if (resourceType !== NESTED_STACK_RESOURCE_TYPE$4) return;
|
|
8033
|
-
if (secrets.size === 0) return;
|
|
8034
|
-
if (!isPlainObject$4(resolvedProperties) || !isPlainObject$4(sourceProperties)) return;
|
|
8035
|
-
if (!Object.hasOwn(resolvedProperties, "Parameters")) return;
|
|
8036
|
-
if (!Object.hasOwn(sourceProperties, "Parameters")) return;
|
|
8037
|
-
const resolvedParameters = resolvedProperties["Parameters"];
|
|
8038
|
-
const sourceParameters = sourceProperties["Parameters"];
|
|
8039
|
-
if (!isPlainObject$4(resolvedParameters) || !isPlainObject$4(sourceParameters)) return;
|
|
8040
|
-
const positioned = redactSecretsForState(markSameGenerationBag({ ...resolvedParameters }), secrets, sourceParameters, rules);
|
|
8041
|
-
let table = nestedStackParameterExpressions.get(secrets);
|
|
8042
|
-
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
8043
|
-
if (typeof resolvedValue !== "string" || !secrets.has(resolvedValue)) continue;
|
|
8044
|
-
const expression = positioned[name];
|
|
8045
|
-
if (typeof expression !== "string") continue;
|
|
8046
|
-
if (!isSingleDynamicReferenceToken(expression)) continue;
|
|
8047
|
-
const sourceLeaf = sourceParameters[name];
|
|
8048
|
-
if (typeof sourceLeaf === "string" && expression !== sourceLeaf) continue;
|
|
8049
|
-
if (expression === resolvedValue) continue;
|
|
8050
|
-
const seenResolvingTo = plaintextIndexOf(secrets).get(expression);
|
|
8051
|
-
if (seenResolvingTo !== void 0 && seenResolvingTo !== resolvedValue) continue;
|
|
8052
|
-
if (typeof sourceLeaf === "string" && resolvedPlaintextOf(secrets, expression) !== resolvedValue) continue;
|
|
8053
|
-
if (table === void 0) {
|
|
8054
|
-
table = /* @__PURE__ */ new Map();
|
|
8055
|
-
nestedStackParameterExpressions.set(secrets, table);
|
|
8056
|
-
}
|
|
8057
|
-
storeAssociation(table, name, expression, resolvedValue);
|
|
8058
|
-
}
|
|
8059
|
-
const framesByValue = /* @__PURE__ */ new Map();
|
|
8060
|
-
const tokensOf = /* @__PURE__ */ new Map();
|
|
8061
|
-
const frameSpellings = /* @__PURE__ */ new Map();
|
|
8062
|
-
const frameSpellingOf = (name) => {
|
|
8063
|
-
if (!frameSpellings.has(name)) frameSpellings.set(name, computeFrameSpelling(name));
|
|
8064
|
-
return frameSpellings.get(name);
|
|
8065
|
-
};
|
|
8066
|
-
const computeFrameSpelling = (name) => {
|
|
8067
|
-
const resolvedValue = resolvedParameters[name];
|
|
8068
|
-
if (typeof resolvedValue !== "string") return void 0;
|
|
8069
|
-
const sourceLeaf = sourceParameters[name];
|
|
8070
|
-
if (typeof sourceLeaf === "string") return sourceLeaf;
|
|
8071
|
-
if (!isPlainObject$4(sourceLeaf)) return void 0;
|
|
8072
|
-
const written = positioned[name];
|
|
8073
|
-
if (typeof written !== "string") return void 0;
|
|
8074
|
-
const rendered = intrinsicSkeletonSegments(sourceLeaf)?.map((s) => s === UNKNOWN_PART ? "\0" : s).join("");
|
|
8075
|
-
const spans = rendered === void 0 ? [] : dynamicReferenceSpans(rendered);
|
|
8076
|
-
if (rendered !== void 0 && spans.length === 1) {
|
|
8077
|
-
const [span] = spans;
|
|
8078
|
-
const ownToken = rendered.slice(span.start, span.end);
|
|
8079
|
-
if (written !== resolvedValue && SPELLED_SECRET_REFERENCE_PREFIXES.some((prefix) => ownToken.startsWith(prefix))) return written;
|
|
8080
|
-
}
|
|
8081
|
-
const substituted = substitutedSpellingOf(secrets, sourceLeaf, resolvedValue);
|
|
8082
|
-
if (substituted === void 0) return void 0;
|
|
8083
|
-
return written === resolvedValue || written === substituted ? substituted : void 0;
|
|
8084
|
-
};
|
|
8085
|
-
const certifiedSpellingOf = (name) => {
|
|
8086
|
-
const sourceLeaf = sourceParameters[name];
|
|
8087
|
-
if (typeof sourceLeaf === "string") return positioned[name] === sourceLeaf ? sourceLeaf : void 0;
|
|
8088
|
-
return frameSpellingOf(name);
|
|
8089
|
-
};
|
|
8090
|
-
const unwrittenValues = /* @__PURE__ */ new Set();
|
|
8091
|
-
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
8092
|
-
if (typeof resolvedValue !== "string") continue;
|
|
8093
|
-
const spelling = frameSpellingOf(name);
|
|
8094
|
-
const frame = spelling === void 0 ? void 0 : singleSpanFrame(resolvedValue, spelling);
|
|
8095
|
-
const frames = framesByValue.get(resolvedValue) ?? /* @__PURE__ */ new Set();
|
|
8096
|
-
const unframed = frame === void 0 || resolvedPlaintextOf(secrets, frame.token) !== frame.middle;
|
|
8097
|
-
frames.add(unframed ? UNFRAMED_SPELLING : `${frame.prefix.length}:${frame.prefix}${frame.suffix}`);
|
|
8098
|
-
framesByValue.set(resolvedValue, frames);
|
|
8099
|
-
if (!unframed) {
|
|
8100
|
-
const tokens = tokensOf.get(resolvedValue) ?? /* @__PURE__ */ new Set();
|
|
8101
|
-
tokens.add(frame.token);
|
|
8102
|
-
tokensOf.set(resolvedValue, tokens);
|
|
8103
|
-
if (typeof sourceParameters[name] !== "string" && positioned[name] !== spelling) unwrittenValues.add(resolvedValue);
|
|
8104
|
-
}
|
|
8105
|
-
}
|
|
8106
|
-
for (const value of unwrittenValues) if (tokensOf.get(value)?.size !== 1) framesByValue.get(value)?.add(UNFRAMED_SPELLING);
|
|
8107
|
-
const rowWithoutParameters = {};
|
|
8108
|
-
for (const [key, value] of Object.entries(resolvedProperties)) if (key !== "Parameters") rowWithoutParameters[key] = value;
|
|
8109
|
-
const outsideLeaves = wholeStringLeavesOf(rowWithoutParameters);
|
|
8110
|
-
const framed = /* @__PURE__ */ new Map();
|
|
8111
|
-
const framedByName = [];
|
|
8112
|
-
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
8113
|
-
if (typeof resolvedValue !== "string") continue;
|
|
8114
|
-
const spelling = certifiedSpellingOf(name);
|
|
8115
|
-
if (spelling === void 0) continue;
|
|
8116
|
-
if (redactSecretsForState(resolvedValue, secrets) !== resolvedValue) continue;
|
|
8117
|
-
const frame = singleSpanFrame(resolvedValue, spelling);
|
|
8118
|
-
if (frame === void 0 || resolvedPlaintextOf(secrets, frame.token) !== frame.middle) continue;
|
|
8119
|
-
if (framesByValue.get(resolvedValue)?.size !== 1) continue;
|
|
8120
|
-
const isNeedle = resolvedValue.length >= 4;
|
|
8121
|
-
const rewrites = (leaf) => leaf === resolvedValue || isNeedle && leaf.includes(resolvedValue);
|
|
8122
|
-
let embedded = false;
|
|
8123
|
-
for (const leaf of outsideLeaves) if (rewrites(leaf)) {
|
|
8124
|
-
embedded = true;
|
|
8125
|
-
break;
|
|
8126
|
-
}
|
|
8127
|
-
for (const other of Object.values(resolvedParameters)) {
|
|
8128
|
-
if (embedded) break;
|
|
8129
|
-
if (typeof other === "string") {
|
|
8130
|
-
if (other !== resolvedValue && rewrites(other)) embedded = true;
|
|
8131
|
-
continue;
|
|
8132
|
-
}
|
|
8133
|
-
for (const leaf of wholeStringLeavesOf(other)) if (rewrites(leaf)) {
|
|
8134
|
-
embedded = true;
|
|
8135
|
-
break;
|
|
8136
|
-
}
|
|
8137
|
-
}
|
|
8138
|
-
if (embedded) continue;
|
|
8139
|
-
framedByName.push([
|
|
8140
|
-
name,
|
|
8141
|
-
spelling,
|
|
8142
|
-
resolvedValue
|
|
8143
|
-
]);
|
|
8144
|
-
if (secrets.get(frame.middle) !== frame.token && tokensOf.get(resolvedValue)?.size !== 1) continue;
|
|
8145
|
-
framed.set(resolvedValue, spelling);
|
|
8146
|
-
}
|
|
8147
|
-
for (const [plaintext, expression] of framed) secrets.set(plaintext, expression);
|
|
8148
|
-
for (const [name, expression, plaintext] of framedByName) {
|
|
8149
|
-
if (table === void 0) {
|
|
8150
|
-
table = /* @__PURE__ */ new Map();
|
|
8151
|
-
nestedStackParameterExpressions.set(secrets, table);
|
|
8152
|
-
}
|
|
8153
|
-
storeAssociation(table, name, expression, plaintext);
|
|
8154
|
-
}
|
|
8155
|
-
}
|
|
8156
|
-
function inheritNestedStackParameterAssociations(childSecrets, parentSecrets) {
|
|
8157
|
-
const table = nestedStackParameterExpressions.get(parentSecrets);
|
|
8158
|
-
if (table === void 0 || table.size === 0) return;
|
|
8159
|
-
let associations = crossStackAssociations.get(childSecrets);
|
|
8160
|
-
for (const [name, association] of table) {
|
|
8161
|
-
const key = crossStackSourceKey({ Ref: name });
|
|
8162
|
-
if (key === void 0) continue;
|
|
8163
|
-
if (associations === void 0) {
|
|
8164
|
-
associations = /* @__PURE__ */ new Map();
|
|
8165
|
-
crossStackAssociations.set(childSecrets, associations);
|
|
8166
|
-
}
|
|
8167
|
-
if (typeof association === "symbol") {
|
|
8168
|
-
associations.set(key, association);
|
|
8169
|
-
continue;
|
|
8170
|
-
}
|
|
8171
|
-
storeAssociation(associations, key, association.expression, association.plaintext);
|
|
8172
|
-
}
|
|
8173
|
-
}
|
|
8174
|
-
function inheritedParameterExpression(parentSecrets, parameterName, resolvedValue) {
|
|
8175
|
-
const association = nestedStackParameterExpressions.get(parentSecrets)?.get(parameterName);
|
|
8176
|
-
if (association === void 0 || typeof association === "symbol") return void 0;
|
|
8177
|
-
if (Array.isArray(resolvedValue)) return certifiedListForLeaf(parentSecrets, association, resolvedValue);
|
|
8178
|
-
return certifiedExpressionForLeaf(parentSecrets, association, resolvedValue);
|
|
8179
|
-
}
|
|
8180
|
-
|
|
8181
8233
|
//#endregion
|
|
8182
8234
|
//#region src/deployment/secret-redaction/unresolved-token-frame.ts
|
|
8183
8235
|
function liveMatchesUnresolvedTokenFrame(send, live, unresolvedTokens, secrets) {
|
|
@@ -17993,7 +18045,7 @@ async function resolveGetAtt(getAtt, context) {
|
|
|
17993
18045
|
const [rawLogicalId, rawAttributeName] = getAtt;
|
|
17994
18046
|
logicalId = rawLogicalId;
|
|
17995
18047
|
const resolvedAttributeName = await this.resolveValue(rawAttributeName, context);
|
|
17996
|
-
if (typeof resolvedAttributeName !== "string") throw new Error(`Fn::GetAtt attribute name for ${this.displayMasked(logicalId, context)} must resolve to a string, got ${typeof resolvedAttributeName}: ${stringifyValue(this.maskValueLeaves(resolvedAttributeName, context))}`);
|
|
18048
|
+
if (typeof resolvedAttributeName !== "string") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetAtt attribute name for ${this.displayMasked(logicalId, context)} must resolve to a string, got ${typeof resolvedAttributeName}: ${stringifyValue(this.maskValueLeaves(resolvedAttributeName, context))}`));
|
|
17997
18049
|
attributeName = resolvedAttributeName;
|
|
17998
18050
|
} else {
|
|
17999
18051
|
const split = splitGetAttStringForm(getAtt);
|
|
@@ -18335,8 +18387,8 @@ function pinSecretVerdict(expression, secret, scope) {
|
|
|
18335
18387
|
async function resolveImportValue(importValueArg, context) {
|
|
18336
18388
|
const sourceKey = crossStackSourceKey({ "Fn::ImportValue": importValueArg });
|
|
18337
18389
|
const exportName = await this.resolveValue(importValueArg, context);
|
|
18338
|
-
if (typeof exportName !== "string") throw new Error(`Fn::ImportValue: export name must resolve to a string, got ${typeof exportName}`);
|
|
18339
|
-
if (!context.stateBackend) throw new Error("Fn::ImportValue: state backend is required for cross-stack references");
|
|
18390
|
+
if (typeof exportName !== "string") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::ImportValue: export name must resolve to a string, got ${typeof exportName}`));
|
|
18391
|
+
if (!context.stateBackend) throw markNonRetryable(/* @__PURE__ */ new Error("Fn::ImportValue: state backend is required for cross-stack references"));
|
|
18340
18392
|
const loggedExportName = this.displayMasked(exportName, context);
|
|
18341
18393
|
this.logger.debug(`Resolving Fn::ImportValue: ${loggedExportName}`);
|
|
18342
18394
|
if (context.exportIndex) {
|
|
@@ -18516,32 +18568,32 @@ function getCfnClient(region) {
|
|
|
18516
18568
|
//#endregion
|
|
18517
18569
|
//#region src/deployment/intrinsic-resolver/stack-output.ts
|
|
18518
18570
|
async function resolveGetStackOutput(arg, context) {
|
|
18519
|
-
if (!arg || typeof arg !== "object" || Array.isArray(arg)) throw new Error(`Fn::GetStackOutput: argument must be an object with StackName/OutputName/Region/RoleArn, got ${arg === null ? "null" : Array.isArray(arg) ? "array" : typeof arg}`);
|
|
18571
|
+
if (!arg || typeof arg !== "object" || Array.isArray(arg)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: argument must be an object with StackName/OutputName/Region/RoleArn, got ${arg === null ? "null" : Array.isArray(arg) ? "array" : typeof arg}`));
|
|
18520
18572
|
const args = arg;
|
|
18521
|
-
if (!("StackName" in args)) throw new Error("Fn::GetStackOutput: StackName is required");
|
|
18522
|
-
if (!("OutputName" in args)) throw new Error("Fn::GetStackOutput: OutputName is required");
|
|
18573
|
+
if (!("StackName" in args)) throw markNonRetryable(/* @__PURE__ */ new Error("Fn::GetStackOutput: StackName is required"));
|
|
18574
|
+
if (!("OutputName" in args)) throw markNonRetryable(/* @__PURE__ */ new Error("Fn::GetStackOutput: OutputName is required"));
|
|
18523
18575
|
const sourceKey = crossStackSourceKey({ "Fn::GetStackOutput": args });
|
|
18524
18576
|
const stackName = await this.resolveValue(args["StackName"], context);
|
|
18525
|
-
if (typeof stackName !== "string" || stackName === "") throw new Error(`Fn::GetStackOutput: StackName must resolve to a non-empty string, got ${typeof stackName}`);
|
|
18577
|
+
if (typeof stackName !== "string" || stackName === "") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: StackName must resolve to a non-empty string, got ${typeof stackName}`));
|
|
18526
18578
|
const outputName = await this.resolveValue(args["OutputName"], context);
|
|
18527
|
-
if (typeof outputName !== "string" || outputName === "") throw new Error(`Fn::GetStackOutput: OutputName must resolve to a non-empty string, got ${typeof outputName}`);
|
|
18579
|
+
if (typeof outputName !== "string" || outputName === "") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: OutputName must resolve to a non-empty string, got ${typeof outputName}`));
|
|
18528
18580
|
let region = this.resolverRegion;
|
|
18529
18581
|
let loggedRegionText = this.logTextOfLeaf(region, context);
|
|
18530
18582
|
if ("Region" in args && args["Region"] !== void 0 && args["Region"] !== null) {
|
|
18531
18583
|
const resolvedRegion = await this.resolveValue(args["Region"], context);
|
|
18532
|
-
if (typeof resolvedRegion !== "string" || resolvedRegion === "") throw new Error(`Fn::GetStackOutput: Region must resolve to a non-empty string, got ${typeof resolvedRegion}`);
|
|
18584
|
+
if (typeof resolvedRegion !== "string" || resolvedRegion === "") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: Region must resolve to a non-empty string, got ${typeof resolvedRegion}`));
|
|
18533
18585
|
const requestedRegion = canonicalizeRegion(resolvedRegion);
|
|
18534
|
-
if (!isClientSafeRegion(requestedRegion)) throw new Error(`Fn::GetStackOutput: ${this.displayMaskedIdent(this.logTextOfLeaf(resolvedRegion, context) !== resolvedRegion ? "***" : resolvedRegion, context, 64)} is not a valid AWS region name. The region selects both the AWS endpoint and the state-file key, so cdkd will not use it.`);
|
|
18586
|
+
if (!isClientSafeRegion(requestedRegion)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: ${this.displayMaskedIdent(this.logTextOfLeaf(resolvedRegion, context) !== resolvedRegion ? "***" : resolvedRegion, context, 64)} is not a valid AWS region name. The region selects both the AWS endpoint and the state-file key, so cdkd will not use it.`));
|
|
18535
18587
|
region = requestedRegion;
|
|
18536
18588
|
loggedRegionText = this.regionLogText(resolvedRegion, context);
|
|
18537
18589
|
}
|
|
18538
18590
|
let roleArn;
|
|
18539
18591
|
if ("RoleArn" in args && args["RoleArn"] !== void 0 && args["RoleArn"] !== null) {
|
|
18540
18592
|
const raw = args["RoleArn"];
|
|
18541
|
-
if (typeof raw !== "string" || raw === "") throw new Error(`Fn::GetStackOutput: RoleArn must be a literal string in the template (no Ref / Fn::GetAtt / Fn::Sub allowed for cross-account references). Got ${raw === null ? "null" : Array.isArray(raw) ? "array" : typeof raw}${typeof raw === "object" ? ` (intrinsic shape: ${this.displayMasked(JSON.stringify(raw).slice(0, 80), context)})` : ""}.`);
|
|
18593
|
+
if (typeof raw !== "string" || raw === "") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: RoleArn must be a literal string in the template (no Ref / Fn::GetAtt / Fn::Sub allowed for cross-account references). Got ${raw === null ? "null" : Array.isArray(raw) ? "array" : typeof raw}${typeof raw === "object" ? ` (intrinsic shape: ${this.displayMasked(JSON.stringify(raw).slice(0, 80), context)})` : ""}.`));
|
|
18542
18594
|
roleArn = raw;
|
|
18543
18595
|
}
|
|
18544
|
-
if (!roleArn && context.stackName && context.stackName === stackName && canonicalizeRegion(region) === canonicalizeRegion(this.resolverRegion)) throw new Error(`Fn::GetStackOutput: cannot reference own stack ${this.displayMaskedIdent(stackName, context, STACK_REF_MAX_CODE_POINTS)} in the same region ${this.displayMaskedIdent(loggedRegionText, context)}`);
|
|
18596
|
+
if (!roleArn && context.stackName && context.stackName === stackName && canonicalizeRegion(region) === canonicalizeRegion(this.resolverRegion)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: cannot reference own stack ${this.displayMaskedIdent(stackName, context, STACK_REF_MAX_CODE_POINTS)} in the same region ${this.displayMaskedIdent(loggedRegionText, context)}`));
|
|
18545
18597
|
const loggedStackName = this.displayMaskedIdent(stackName, context, STACK_REF_MAX_CODE_POINTS);
|
|
18546
18598
|
const loggedOutputName = this.displayMaskedIdent(outputName, context);
|
|
18547
18599
|
const loggedRegion = this.displayMasked(loggedRegionText, context);
|
|
@@ -18559,7 +18611,7 @@ async function resolveGetStackOutput(arg, context) {
|
|
|
18559
18611
|
if (cfnOutputs) {
|
|
18560
18612
|
if (!Object.hasOwn(cfnOutputs, outputName)) {
|
|
18561
18613
|
const available = this.describeAvailableOutputs(Object.keys(cfnOutputs), context);
|
|
18562
|
-
throw new Error(`Fn::GetStackOutput: output ${loggedOutputName} not found in CloudFormation stack ${loggedStackName} (${displayIdent(loggedRegion)}). Available outputs: ${available}`);
|
|
18614
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: output ${loggedOutputName} not found in CloudFormation stack ${loggedStackName} (${displayIdent(loggedRegion)}). Available outputs: ${available}`));
|
|
18563
18615
|
}
|
|
18564
18616
|
const value = cfnOutputs[outputName];
|
|
18565
18617
|
this.logger.info(`Resolved Fn::GetStackOutput: StackName=${loggedStackName}, Region=${loggedRegion}, OutputName=${loggedOutputName} (from CloudFormation stack outputs; weak reference — producer is not cdkd-managed)`);
|
|
@@ -18572,7 +18624,7 @@ async function resolveGetStackOutput(arg, context) {
|
|
|
18572
18624
|
const outputs = stateData.state.outputs ?? {};
|
|
18573
18625
|
if (!Object.hasOwn(outputs, outputName)) {
|
|
18574
18626
|
const available = this.describeAvailableOutputs(Object.keys(outputs), context);
|
|
18575
|
-
throw new Error(`Fn::GetStackOutput: output ${loggedOutputName} not found in stack ${loggedStackName} (${displayIdent(loggedRegion)}). Available outputs: ${available}`);
|
|
18627
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: output ${loggedOutputName} not found in stack ${loggedStackName} (${displayIdent(loggedRegion)}). Available outputs: ${available}`));
|
|
18576
18628
|
}
|
|
18577
18629
|
const value = outputs[outputName];
|
|
18578
18630
|
this.logger.info(`Resolved Fn::GetStackOutput: StackName=${loggedStackName}, Region=${loggedRegion}, OutputName=${loggedOutputName}${roleArn ? `, RoleArn=${shownRoleArn}` : ""} (${carriesDynamicReference(value) ? "redacted dynamic reference" : "literal value"})`);
|
|
@@ -18825,7 +18877,7 @@ async function applyRoleArnIfSet(opts) {
|
|
|
18825
18877
|
//#endregion
|
|
18826
18878
|
//#region src/deployment/intrinsic-resolver/stack-state.ts
|
|
18827
18879
|
async function getSameAccountStackState(stackName, region, context) {
|
|
18828
|
-
if (!context.stateBackend) throw new Error("Fn::GetStackOutput: state backend is required for cross-stack references");
|
|
18880
|
+
if (!context.stateBackend) throw markNonRetryable(/* @__PURE__ */ new Error("Fn::GetStackOutput: state backend is required for cross-stack references"));
|
|
18829
18881
|
return context.stateBackend.getState(stackName, region);
|
|
18830
18882
|
}
|
|
18831
18883
|
async function getCrossAccountStackState(roleArn, stackName, region, context) {
|
|
@@ -18834,7 +18886,7 @@ async function getCrossAccountStackState(roleArn, stackName, region, context) {
|
|
|
18834
18886
|
const shownRoleArn = displayIdent(roleArn, { maxCodePoints: 613 });
|
|
18835
18887
|
const bounded = !/\s/.test(roleArn) && shownRoleArn === roleArn ? `'${shownRoleArn}'` : shellBoundedDisplay(shownRoleArn);
|
|
18836
18888
|
const subject = bounded === "a value that cannot be shown safely here" ? `the RoleArn argument (${UNSHOWABLE_VALUE})` : `RoleArn ${bounded}`;
|
|
18837
|
-
throw new Error(`Fn::GetStackOutput: ${subject} is not a valid IAM role ARN. Expected shape: arn:<partition>:iam::<12-digit-account-id>:role/<role-name> (e.g. arn:aws:iam::123456789012:role/MyRole, arn:aws-us-gov:iam::...).`);
|
|
18889
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetStackOutput: ${subject} is not a valid IAM role ARN. Expected shape: arn:<partition>:iam::<12-digit-account-id>:role/<role-name> (e.g. arn:aws:iam::123456789012:role/MyRole, arn:aws-us-gov:iam::...).`));
|
|
18838
18890
|
}
|
|
18839
18891
|
const credentials = await assumeRoleForCrossAccountStateRead(roleArn);
|
|
18840
18892
|
const { bucket, region: bucketRegion } = await resolveCrossAccountStateBucket(parsed.accountId, credentials);
|
|
@@ -19139,7 +19191,7 @@ async function resolveSecretsManagerReference(inner, context, nameLogText) {
|
|
|
19139
19191
|
versionId = remainingParts[2] || "";
|
|
19140
19192
|
} else secretId = afterService;
|
|
19141
19193
|
if (!versionStage) versionStage = "AWSCURRENT";
|
|
19142
|
-
if (!secretId) throw new Error("Dynamic reference: secretsmanager SECRET_ID is required");
|
|
19194
|
+
if (!secretId) throw markNonRetryable(/* @__PURE__ */ new Error("Dynamic reference: secretsmanager SECRET_ID is required"));
|
|
19143
19195
|
const loggedSecretId = this.displayMasked(nameLogText(secretId), context);
|
|
19144
19196
|
const loggedJsonKey = this.displayMasked(nameLogText(jsonKey), context);
|
|
19145
19197
|
this.logger.debug(`Resolving dynamic reference: secretsmanager:${loggedSecretId}:SecretString:${loggedJsonKey}:${this.displayMasked(nameLogText(versionStage), context)}:${this.displayMasked(nameLogText(versionId), context)}`);
|
|
@@ -19154,14 +19206,14 @@ async function resolveSecretsManagerReference(inner, context, nameLogText) {
|
|
|
19154
19206
|
[versionStage, this.displayMasked(nameLogText(versionStage), context)],
|
|
19155
19207
|
[versionId, this.displayMasked(nameLogText(versionId), context)]
|
|
19156
19208
|
], context))).SecretString;
|
|
19157
|
-
if (!secretString) throw new Error(`Dynamic reference: secret ${quotedRender(loggedSecretId, "'")} does not contain a SecretString value`);
|
|
19209
|
+
if (!secretString) throw markNonRetryable(/* @__PURE__ */ new Error(`Dynamic reference: secret ${quotedRender(loggedSecretId, "'")} does not contain a SecretString value`));
|
|
19158
19210
|
if (jsonKey) try {
|
|
19159
19211
|
const parsed = JSON.parse(secretString);
|
|
19160
19212
|
const keyValue = Object.hasOwn(parsed, jsonKey) ? parsed[jsonKey] : void 0;
|
|
19161
|
-
if (keyValue === void 0) throw new Error(`Dynamic reference: key ${quotedRender(loggedJsonKey, "'")} not found in secret ${quotedRender(loggedSecretId, "'")}`);
|
|
19213
|
+
if (keyValue === void 0) throw markNonRetryable(/* @__PURE__ */ new Error(`Dynamic reference: key ${quotedRender(loggedJsonKey, "'")} not found in secret ${quotedRender(loggedSecretId, "'")}`));
|
|
19162
19214
|
return stringifyValue(keyValue);
|
|
19163
19215
|
} catch (error) {
|
|
19164
|
-
if (error instanceof SyntaxError) throw new Error(`Dynamic reference: secret ${quotedRender(loggedSecretId, "'")} is not valid JSON but JSON_KEY ${quotedRender(loggedJsonKey, "'")} was specified`);
|
|
19216
|
+
if (error instanceof SyntaxError) throw markNonRetryable(/* @__PURE__ */ new Error(`Dynamic reference: secret ${quotedRender(loggedSecretId, "'")} is not valid JSON but JSON_KEY ${quotedRender(loggedJsonKey, "'")} was specified`));
|
|
19165
19217
|
throw error;
|
|
19166
19218
|
}
|
|
19167
19219
|
return secretString;
|
|
@@ -19180,7 +19232,7 @@ async function sendWithThrottleRetry(operation, label, masks) {
|
|
|
19180
19232
|
}
|
|
19181
19233
|
async function resolveSSMReference(parts, decrypt, service, context, nameLogText) {
|
|
19182
19234
|
const parameterName = parts.slice(1).join(":");
|
|
19183
|
-
if (!parameterName) throw new Error(`Dynamic reference: ${service} PARAMETER_NAME is required`);
|
|
19235
|
+
if (!parameterName) throw markNonRetryable(/* @__PURE__ */ new Error(`Dynamic reference: ${service} PARAMETER_NAME is required`));
|
|
19184
19236
|
const loggedParameterName = this.displayMasked(nameLogText(parameterName), context);
|
|
19185
19237
|
this.logger.debug(`Resolving dynamic reference: ${service}:${loggedParameterName}`);
|
|
19186
19238
|
const client = this.clientsForRegion(this.explicitRegion).ssm;
|
|
@@ -19190,7 +19242,7 @@ async function resolveSSMReference(parts, decrypt, service, context, nameLogText
|
|
|
19190
19242
|
});
|
|
19191
19243
|
const response = await this.sendWithThrottleRetry(() => client.send(command), `${service}:${loggedParameterName}`, this.namedRequestMasks([[parameterName, loggedParameterName]], context));
|
|
19192
19244
|
const paramValue = response.Parameter?.Value;
|
|
19193
|
-
if (paramValue === void 0 || paramValue === null) throw new Error(`Dynamic reference: SSM parameter ${quotedRender(loggedParameterName, "'")} not found or has no value`);
|
|
19245
|
+
if (paramValue === void 0 || paramValue === null) throw markNonRetryable(/* @__PURE__ */ new Error(`Dynamic reference: SSM parameter ${quotedRender(loggedParameterName, "'")} not found or has no value`));
|
|
19194
19246
|
const paramType = response.Parameter?.Type;
|
|
19195
19247
|
const secure = paramType !== "String" && paramType !== "StringList";
|
|
19196
19248
|
if (secure && paramType !== "SecureString" && !this.warnedUnrecognizedSsmTypes.has(injectiveKey(parameterName, String(paramType)))) {
|
|
@@ -19234,7 +19286,7 @@ async function resolveJoin(joinArgs, context, source) {
|
|
|
19234
19286
|
const [delimiter, rawValues] = joinArgs;
|
|
19235
19287
|
let values = rawValues;
|
|
19236
19288
|
if (!Array.isArray(values)) values = await this.resolveValue(values, context);
|
|
19237
|
-
if (!Array.isArray(values)) throw new Error(`Fn::Join's second argument must be a list (an array literal or a list-returning intrinsic such as Fn::Cidr / Fn::GetAZs / Fn::Split / a Ref to a list-typed parameter — any List<...> type or CommaDelimitedList), but resolved to ${typeof values}`);
|
|
19289
|
+
if (!Array.isArray(values)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Join's second argument must be a list (an array literal or a list-returning intrinsic such as Fn::Cidr / Fn::GetAZs / Fn::Split / a Ref to a list-typed parameter — any List<...> type or CommaDelimitedList), but resolved to ${typeof values}`));
|
|
19238
19290
|
const literalList = Array.isArray(rawValues);
|
|
19239
19291
|
const resolvedParts = await allSettledKeepingFirstRejection(() => values.map(async (v) => {
|
|
19240
19292
|
if (typeof v === "string") {
|
|
@@ -19317,7 +19369,7 @@ async function resolveSelect(selectArgs, context) {
|
|
|
19317
19369
|
throw markNonRetryable(new IntrinsicResolutionRefusalError(`Fn::Select: the index${sourceClause} must resolve to a non-negative integer (a number, or its decimal string with no leading zero), got ${this.describeOperandShape(resolvedIndex, context)}. Use a literal, a Ref to a parameter or an Fn::FindInMap that yields one.`));
|
|
19318
19370
|
}
|
|
19319
19371
|
const resolvedList = await this.resolveValue(list, context);
|
|
19320
|
-
if (!Array.isArray(resolvedList)) throw new Error(`Fn::Select: list must be an array, got ${typeof resolvedList}`);
|
|
19372
|
+
if (!Array.isArray(resolvedList)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Select: list must be an array, got ${typeof resolvedList}`));
|
|
19321
19373
|
const loggedPosition = this.displayMasked(String(position), context);
|
|
19322
19374
|
if (position >= resolvedList.length) {
|
|
19323
19375
|
if (loggedPosition !== String(position)) throw markNonRetryable(new IntrinsicResolutionRefusalError(`Fn::Select: the index ${loggedPosition} is out of bounds (array length: ${resolvedList.length}), and it resolves from a secret value, so cdkd will not write it into the OutOfBounds placeholder.`));
|
|
@@ -19653,7 +19705,7 @@ async function resolveConditionReference(conditionName, context) {
|
|
|
19653
19705
|
return false;
|
|
19654
19706
|
}
|
|
19655
19707
|
async function resolveAnd(conditions, context) {
|
|
19656
|
-
if (!Array.isArray(conditions) || conditions.length < 2 || conditions.length > 10) throw new Error(`Fn::And requires between 2 and 10 conditions, got ${conditions.length}`);
|
|
19708
|
+
if (!Array.isArray(conditions) || conditions.length < 2 || conditions.length > 10) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::And requires between 2 and 10 conditions, got ${conditions.length}`));
|
|
19657
19709
|
const results = [];
|
|
19658
19710
|
for (const condition of conditions) {
|
|
19659
19711
|
const resolved = await this.resolveValue(condition, context);
|
|
@@ -19664,7 +19716,7 @@ async function resolveAnd(conditions, context) {
|
|
|
19664
19716
|
return result;
|
|
19665
19717
|
}
|
|
19666
19718
|
async function resolveOr(conditions, context) {
|
|
19667
|
-
if (!Array.isArray(conditions) || conditions.length < 2 || conditions.length > 10) throw new Error(`Fn::Or requires between 2 and 10 conditions, got ${conditions.length}`);
|
|
19719
|
+
if (!Array.isArray(conditions) || conditions.length < 2 || conditions.length > 10) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Or requires between 2 and 10 conditions, got ${conditions.length}`));
|
|
19668
19720
|
const results = [];
|
|
19669
19721
|
for (const condition of conditions) {
|
|
19670
19722
|
const resolved = await this.resolveValue(condition, context);
|
|
@@ -19675,7 +19727,7 @@ async function resolveOr(conditions, context) {
|
|
|
19675
19727
|
return result;
|
|
19676
19728
|
}
|
|
19677
19729
|
async function resolveNot(notArgs, context) {
|
|
19678
|
-
if (!Array.isArray(notArgs) || notArgs.length !== 1) throw new Error(`Fn::Not requires exactly one condition, got ${Array.isArray(notArgs) ? notArgs.length : 0}`);
|
|
19730
|
+
if (!Array.isArray(notArgs) || notArgs.length !== 1) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Not requires exactly one condition, got ${Array.isArray(notArgs) ? notArgs.length : 0}`));
|
|
19679
19731
|
const [condition] = notArgs;
|
|
19680
19732
|
const resolved = await this.resolveValue(condition, context);
|
|
19681
19733
|
const result = !resolved;
|
|
@@ -19693,20 +19745,20 @@ async function resolveFindInMap(findInMapArgs, context) {
|
|
|
19693
19745
|
const map = mappings != null && Object.hasOwn(mappings, mapName) ? mappings[mapName] : void 0;
|
|
19694
19746
|
if (!mappings) {
|
|
19695
19747
|
if (hasDefaultValue) return await resolveDefault();
|
|
19696
|
-
throw new Error(`Fn::FindInMap: no Mappings section found in template`);
|
|
19748
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::FindInMap: no Mappings section found in template`));
|
|
19697
19749
|
}
|
|
19698
19750
|
if (!map) {
|
|
19699
19751
|
if (hasDefaultValue) return await resolveDefault();
|
|
19700
|
-
throw new Error(`Fn::FindInMap: mapping ${quotedRender(this.displayMasked(mapName, context), "'")} not found in Mappings section`);
|
|
19752
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::FindInMap: mapping ${quotedRender(this.displayMasked(mapName, context), "'")} not found in Mappings section`));
|
|
19701
19753
|
}
|
|
19702
19754
|
const topLevel = Object.hasOwn(map, topLevelKey) ? map[topLevelKey] : void 0;
|
|
19703
19755
|
if (!topLevel || typeof topLevel !== "object") {
|
|
19704
19756
|
if (hasDefaultValue) return await resolveDefault();
|
|
19705
|
-
throw new Error(`Fn::FindInMap: top-level key ${quotedRender(this.displayMasked(topLevelKey, context), "'")} not found in mapping ${quotedRender(this.displayMasked(mapName, context), "'")}`);
|
|
19757
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::FindInMap: top-level key ${quotedRender(this.displayMasked(topLevelKey, context), "'")} not found in mapping ${quotedRender(this.displayMasked(mapName, context), "'")}`));
|
|
19706
19758
|
}
|
|
19707
19759
|
if (!Object.hasOwn(topLevel, secondLevelKey)) {
|
|
19708
19760
|
if (hasDefaultValue) return await resolveDefault();
|
|
19709
|
-
throw new Error(`Fn::FindInMap: second-level key ${quotedRender(this.displayMasked(secondLevelKey, context), "'")} not found in mapping ${quotedRender(this.displayMasked(mapName, context), "'")} under top-level key ${quotedRender(this.displayMasked(topLevelKey, context), "'")}`);
|
|
19761
|
+
throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::FindInMap: second-level key ${quotedRender(this.displayMasked(secondLevelKey, context), "'")} not found in mapping ${quotedRender(this.displayMasked(mapName, context), "'")} under top-level key ${quotedRender(this.displayMasked(topLevelKey, context), "'")}`));
|
|
19710
19762
|
}
|
|
19711
19763
|
const result = topLevel[secondLevelKey];
|
|
19712
19764
|
this.logger.debug(`Resolved Fn::FindInMap: ${this.logRender(mapName, context)}.${this.logRender(topLevelKey, context)}.${this.logRender(secondLevelKey, context)} resolved to ${this.logRender(JSON.stringify(this.maskValueLeaves(result, context)), context, { structured: true })}`);
|
|
@@ -19714,7 +19766,7 @@ async function resolveFindInMap(findInMapArgs, context) {
|
|
|
19714
19766
|
}
|
|
19715
19767
|
async function resolveBase64(value, context) {
|
|
19716
19768
|
const resolvedValue = await this.resolveValue(value, context);
|
|
19717
|
-
if (typeof resolvedValue !== "string") throw new Error(`Fn::Base64: value must resolve to a string, got ${typeof resolvedValue}`);
|
|
19769
|
+
if (typeof resolvedValue !== "string") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Base64: value must resolve to a string, got ${typeof resolvedValue}`));
|
|
19718
19770
|
if (context.skipDynamicReferences === true && keepsSecretReferenceToken(resolvedValue) && !(context.recordedSecretValues !== void 0 && embedsFreshNoEchoValue(resolvedValue, context.recordedSecretValues))) {
|
|
19719
19771
|
this.logger.debug(safeMsg`Resolved Fn::Base64: ${this.logRender(this.logTextOfLeaf(resolvedValue, context), context)} resolved to ${"***"} (an unresolved secret reference, compared as the mask the deploy persists)`);
|
|
19720
19772
|
return "***";
|
|
@@ -19742,7 +19794,7 @@ async function resolveGetAZs(value, context) {
|
|
|
19742
19794
|
let loggedRegionText;
|
|
19743
19795
|
if (typeof resolvedValue === "string" && resolvedValue !== "") {
|
|
19744
19796
|
const requested = canonicalizeRegion(resolvedValue);
|
|
19745
|
-
if (!isClientSafeRegion(requested)) throw new Error(`Fn::GetAZs: the value ${quotedRender(this.displayMasked(this.logTextOfLeaf(resolvedValue, context) !== resolvedValue ? "***" : resolvedValue, context).slice(0, 64), "'")} is not a valid AWS region name. A region is substituted into the AWS service hostname, so cdkd will not build a client from it.`);
|
|
19797
|
+
if (!isClientSafeRegion(requested)) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetAZs: the value ${quotedRender(this.displayMasked(this.logTextOfLeaf(resolvedValue, context) !== resolvedValue ? "***" : resolvedValue, context).slice(0, 64), "'")} is not a valid AWS region name. A region is substituted into the AWS service hostname, so cdkd will not build a client from it.`));
|
|
19746
19798
|
region = requested;
|
|
19747
19799
|
clientRegion = requested;
|
|
19748
19800
|
loggedRegionText = this.regionLogText(resolvedValue, context);
|
|
@@ -19771,7 +19823,7 @@ async function resolveGetAZs(value, context) {
|
|
|
19771
19823
|
const masks = this.namedRequestMasks([[region, loggedRegion]], context);
|
|
19772
19824
|
throw new Error(`Fn::GetAZs: failed to describe availability zones for region ${quotedRender(loggedRegion, "'")}: ${masks.text(error instanceof Error ? error.message : String(error))}`);
|
|
19773
19825
|
}
|
|
19774
|
-
if (azNames.length === 0) throw new Error(`Fn::GetAZs: no availability zones returned for region ${quotedRender(this.displayMasked(loggedRegionText ?? region, context), "'")}. Either the region is not enabled on this account (opt-in regions must be enabled before use), or the request was answered by a different region's endpoint.`);
|
|
19826
|
+
if (azNames.length === 0) throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::GetAZs: no availability zones returned for region ${quotedRender(this.displayMasked(loggedRegionText ?? region, context), "'")}. Either the region is not enabled on this account (opt-in regions must be enabled before use), or the request was answered by a different region's endpoint.`));
|
|
19775
19827
|
cachedAvailabilityZones.set(azCacheKey, azNames);
|
|
19776
19828
|
this.logger.debug(`Resolved Fn::GetAZs: ${this.logRender(loggedRegionText ?? region, context)} resolved to ${this.logRender(JSON.stringify(this.maskValueLeaves(azNames, context)), context, { structured: true })}`);
|
|
19777
19829
|
return azNames;
|
|
@@ -19797,7 +19849,7 @@ async function resolveCidr(args, context) {
|
|
|
19797
19849
|
const ipBlock = await this.resolveValue(rawIpBlock, context);
|
|
19798
19850
|
const count = Number(await this.resolveValue(rawCount, context));
|
|
19799
19851
|
const cidrBits = Number(await this.resolveValue(rawCidrBits, context));
|
|
19800
|
-
if (!ipBlock || typeof ipBlock !== "string") throw new Error(`Fn::Cidr: ipBlock must be a string, got ${typeof ipBlock}: ${JSON.stringify(this.maskValueLeaves(ipBlock, context))}`);
|
|
19852
|
+
if (!ipBlock || typeof ipBlock !== "string") throw markNonRetryable(/* @__PURE__ */ new Error(`Fn::Cidr: ipBlock must be a string, got ${typeof ipBlock}: ${JSON.stringify(this.maskValueLeaves(ipBlock, context))}`));
|
|
19801
19853
|
this.logger.debug(`Resolving Fn::Cidr: ipBlock=${this.displayMasked(JSON.stringify(this.maskValueLeaves(ipBlock, context)), context)}, count=${this.displayMasked(String(count), context)}, cidrBits=${this.displayMasked(String(cidrBits), context)}`);
|
|
19802
19854
|
const isIpv6 = ipBlock.includes(":");
|
|
19803
19855
|
const results = [];
|
|
@@ -20095,7 +20147,7 @@ async function resolveParameters(template, userParameters, options) {
|
|
|
20095
20147
|
let referencedNames;
|
|
20096
20148
|
for (const [name, definition] of Object.entries(templateParameters)) {
|
|
20097
20149
|
const paramDef = definition;
|
|
20098
|
-
if (isUnboundTemplateParameter(name, template, userParameters)) throw new Error(`Parameter ${maskInherited(name)} is required but no value was provided and no default exists`);
|
|
20150
|
+
if (isUnboundTemplateParameter(name, template, userParameters)) throw markNonRetryable(/* @__PURE__ */ new Error(`Parameter ${maskInherited(name)} is required but no value was provided and no default exists`));
|
|
20099
20151
|
if (userParameters && Object.hasOwn(userParameters, name)) {
|
|
20100
20152
|
const userValue = userParameters[name];
|
|
20101
20153
|
if (userValue !== void 0) {
|
|
@@ -20197,6 +20249,7 @@ function recordInheritedParameterSecrets(parameterName, value, context) {
|
|
|
20197
20249
|
for (const [plaintext, expression] of inheritedSecretsCarriedBy(value, inherited)) {
|
|
20198
20250
|
const own = inheritedParameterExpression(inherited, parameterName, plaintext);
|
|
20199
20251
|
recorded.set(plaintext, typeof own === "string" ? own : expression);
|
|
20252
|
+
recordInheritedParameterRead(recorded, inherited, parameterName);
|
|
20200
20253
|
carryFreshNoEchoMark(inherited, recorded, plaintext);
|
|
20201
20254
|
}
|
|
20202
20255
|
}
|
|
@@ -20420,7 +20473,7 @@ var IntrinsicFunctionResolver = class IntrinsicFunctionResolver {
|
|
|
20420
20473
|
if ("Fn::GetAZs" in obj) return await this.resolveGetAZs(obj["Fn::GetAZs"], context);
|
|
20421
20474
|
if ("Fn::Cidr" in obj) return await this.resolveCidr(obj["Fn::Cidr"], context);
|
|
20422
20475
|
const unknownIntrinsicKey = detectUnknownIntrinsicKey(obj);
|
|
20423
|
-
if (unknownIntrinsicKey !== void 0) throw buildUnknownIntrinsicError(unknownIntrinsicKey);
|
|
20476
|
+
if (unknownIntrinsicKey !== void 0) throw markNonRetryable(buildUnknownIntrinsicError(unknownIntrinsicKey));
|
|
20424
20477
|
const resolved = {};
|
|
20425
20478
|
for (const [key, val] of Object.entries(obj)) {
|
|
20426
20479
|
const resolvedVal = context.abandonedResolutions === void 0 ? await this.resolveValue(val, context) : await this.resolveKeyUnit(key, val, context, context.abandonedResolutions);
|
|
@@ -22050,7 +22103,7 @@ var CloudControlProvider = class {
|
|
|
22050
22103
|
const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
|
|
22051
22104
|
if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
|
|
22052
22105
|
this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
|
|
22053
|
-
const { ASGProvider } = await import("./asg-provider-
|
|
22106
|
+
const { ASGProvider } = await import("./asg-provider-BU0YONBp.js");
|
|
22054
22107
|
const delegateRegion = ambientRegion();
|
|
22055
22108
|
let asgProvider = this.asgDeleteDelegates.get(delegateRegion);
|
|
22056
22109
|
if (asgProvider === void 0) {
|
|
@@ -22156,7 +22209,7 @@ var CloudControlProvider = class {
|
|
|
22156
22209
|
const family = SDK_DELETE_FAMILIES.get(resourceType);
|
|
22157
22210
|
const cached = this.sdkDeleteDelegates.get(family);
|
|
22158
22211
|
if (cached !== void 0 && cached.region === ccRegion) return cached.provider;
|
|
22159
|
-
const provider = family === "rds" ? new (await (import("./rds-provider-
|
|
22212
|
+
const provider = family === "rds" ? new (await (import("./rds-provider-Cf5P2so_.js"))).RDSProvider({ region: ccRegion }) : new (await (import("./neptune-provider-C3f-vDOh.js"))).NeptuneProvider({ region: ccRegion });
|
|
22160
22213
|
this.sdkDeleteDelegates.set(family, {
|
|
22161
22214
|
region: ccRegion,
|
|
22162
22215
|
provider
|
|
@@ -27446,44 +27499,6 @@ var DeploymentEventsReader = class {
|
|
|
27446
27499
|
}
|
|
27447
27500
|
};
|
|
27448
27501
|
|
|
27449
|
-
//#endregion
|
|
27450
|
-
//#region src/deployment/update-outcome.ts
|
|
27451
|
-
function updatePartialReason(result) {
|
|
27452
|
-
if (!result || result.outcome !== "partial") return void 0;
|
|
27453
|
-
if (typeof result.reason !== "string") return UNSPECIFIED_PARTIAL_REASON;
|
|
27454
|
-
const trimmed = result.reason.trim();
|
|
27455
|
-
return trimmed === "" ? UNSPECIFIED_PARTIAL_REASON : trimmed;
|
|
27456
|
-
}
|
|
27457
|
-
const UNSPECIFIED_PARTIAL_REASON = "provider reported a partial update without a reason";
|
|
27458
|
-
function updatePartialMessage(reason) {
|
|
27459
|
-
return `partial (${reason})`;
|
|
27460
|
-
}
|
|
27461
|
-
|
|
27462
|
-
//#endregion
|
|
27463
|
-
//#region src/provisioning/redacted-delete-address.ts
|
|
27464
|
-
function isRedactedRecordedValue(value) {
|
|
27465
|
-
if (carriesSecretMask(value)) return true;
|
|
27466
|
-
let text;
|
|
27467
|
-
try {
|
|
27468
|
-
text = typeof value === "string" ? value : JSON.stringify(value);
|
|
27469
|
-
} catch {
|
|
27470
|
-
return false;
|
|
27471
|
-
}
|
|
27472
|
-
return text !== void 0 && dynamicReferenceTokens(text).length > 0;
|
|
27473
|
-
}
|
|
27474
|
-
const REDACTED_DELETE_ADDRESS_SKIP_REASON = "redacted address property in state — no delete issued";
|
|
27475
|
-
function redactedDeleteAddressFields(fields) {
|
|
27476
|
-
return Object.keys(fields).filter((key) => isRedactedRecordedValue(fields[key]));
|
|
27477
|
-
}
|
|
27478
|
-
function redactedDeleteAddressSkip(logger, logicalId, what, redactedFields, context) {
|
|
27479
|
-
if (redactedFields.length === 0) return void 0;
|
|
27480
|
-
logger.warn(safeMsg`${what} ${logicalId} is recorded in state with ${redactedFields.join(", ")} ` + "redacted (the '***' mask of a NoEcho value it read, or a secret '{{resolve:...}}' reference), which names nothing in AWS; skipping deletion — no AWS call is issued, so the resource is LEFT IN PLACE unless a parent resource this run also deletes removes it (then only the record is stale). Re-deploying records the same redaction again. The state record is KEPT and the run reports the skip: on 'cdkd destroy' / 'cdkd state destroy' (which exits non-zero) and, since issue 1762, on the plain DELETE of a resource removed from the template during cdkd deploy. Remove the resource by hand, " + safeMsg`then drop the record with ${stateOrphanRecordRemedy(context, logicalId)}. ` + "NOTE a deploy-side REPLACEMENT or rollback delete instead FAILS the resource (https://github.com/go-to-k/cdkd/issues/1762) — the old resource is left untracked there, so remove it by hand.");
|
|
27481
|
-
return {
|
|
27482
|
-
outcome: "skipped",
|
|
27483
|
-
reason: REDACTED_DELETE_ADDRESS_SKIP_REASON
|
|
27484
|
-
};
|
|
27485
|
-
}
|
|
27486
|
-
|
|
27487
27502
|
//#endregion
|
|
27488
27503
|
//#region src/provisioning/final-snapshot.ts
|
|
27489
27504
|
const ATOMIC_FINAL_SNAPSHOT_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -27865,6 +27880,24 @@ function recordRollbackSkip(scope, op, reason) {
|
|
|
27865
27880
|
reason: scope.mask(reason)
|
|
27866
27881
|
});
|
|
27867
27882
|
}
|
|
27883
|
+
function rollbackCannotAddress(record, opResourceType, route, physicalId) {
|
|
27884
|
+
return !(record?.resourceType === "AWS::CloudFormation::Stack" && opResourceType === "AWS::CloudFormation::Stack" && record.provisionedBy !== "cc-api" && route !== "cc-api") && !hasAddressablePhysicalId({ physicalId });
|
|
27885
|
+
}
|
|
27886
|
+
function retainedSurvivorId(record, op) {
|
|
27887
|
+
if (hasAddressablePhysicalId(record)) return record.physicalId;
|
|
27888
|
+
if (hasAddressablePhysicalId(op)) return op.physicalId;
|
|
27889
|
+
}
|
|
27890
|
+
const UNADDRESSABLE_SKIP_CAUSE = "Its recorded 'physicalId' is not a non-empty string, so cdkd cannot address the resource in AWS and sent nothing for it; the rollback left it and its state record exactly as they are.";
|
|
27891
|
+
const UNADDRESSABLE_JOURNAL_SKIP_CAUSE = "Its rollback-journal entry's 'physicalId' is not a non-empty string and no state record holds the resource, so cdkd cannot address it in AWS and sent nothing for it; if it was created in AWS, delete it manually.";
|
|
27892
|
+
function skipUnaddressableReplay(scope, logger, op, what, source = "record") {
|
|
27893
|
+
if (source === "journal") {
|
|
27894
|
+
logger.warn(safeMsg` Rollback: Cannot ${what} ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) ` + "— its rollback journal entry has no non-empty string 'physicalId' and no state record holds it, so cdkd cannot address it in AWS and sent nothing for it. If it was created in AWS, delete it manually.");
|
|
27895
|
+
recordRollbackSkip(scope, op, UNADDRESSABLE_JOURNAL_SKIP_CAUSE);
|
|
27896
|
+
return;
|
|
27897
|
+
}
|
|
27898
|
+
logger.warn(safeMsg` Rollback: Cannot ${what} ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}) ` + "— its state record has no non-empty string 'physicalId', so cdkd cannot address it in AWS and sent nothing for it. The resource and its state record are left exactly as they are. Repair the record's 'physicalId' (inspect it with `cdkd state show`), then re-converge it with `cdkd deploy`.");
|
|
27899
|
+
recordRollbackSkip(scope, op, UNADDRESSABLE_SKIP_CAUSE);
|
|
27900
|
+
}
|
|
27868
27901
|
function effectiveProvisionedBy(record, fallbackProvisionedBy) {
|
|
27869
27902
|
return record?.provisionedBy ?? fallbackProvisionedBy;
|
|
27870
27903
|
}
|
|
@@ -28129,6 +28162,172 @@ async function prepareCreateRollbackFinalSnapshot(op, provisionedBy, ctx, mask)
|
|
|
28129
28162
|
}
|
|
28130
28163
|
}
|
|
28131
28164
|
|
|
28165
|
+
//#endregion
|
|
28166
|
+
//#region src/deployment/secret-name-needles.ts
|
|
28167
|
+
function secretNameNeedlesOf(logicalId, record, secrets, options) {
|
|
28168
|
+
const physicalId = typeof record?.physicalId === "string" && record.physicalId !== "" ? record.physicalId : void 0;
|
|
28169
|
+
const bag = secrets !== void 0 && hasMaskableValues(secrets) ? secrets : void 0;
|
|
28170
|
+
const mask = (text) => bag === void 0 ? text : maskSecretsInText(text, bag);
|
|
28171
|
+
const unresolved = (value) => value.includes("{{resolve:") || value === "***";
|
|
28172
|
+
const named = {
|
|
28173
|
+
resourceType: record?.resourceType,
|
|
28174
|
+
properties: record?.properties,
|
|
28175
|
+
logicalId
|
|
28176
|
+
};
|
|
28177
|
+
const needles = /* @__PURE__ */ new Set();
|
|
28178
|
+
const add = (needle) => {
|
|
28179
|
+
if (typeof needle === "string" && needle !== "") needles.add(needle);
|
|
28180
|
+
};
|
|
28181
|
+
for (const [raw, derived] of secretDerivedNamePairs({
|
|
28182
|
+
...named,
|
|
28183
|
+
physicalIds: []
|
|
28184
|
+
})) if (typeof raw === "string" && !unresolved(raw) && isSecretDerivedValue(raw, mask)) add(derived);
|
|
28185
|
+
for (const [raw, spelling] of secretDerivedNamePairs({
|
|
28186
|
+
...named,
|
|
28187
|
+
physicalIds: [physicalId ?? "cdkd-no-physical-id-yet"]
|
|
28188
|
+
})) {
|
|
28189
|
+
if (!isSecretDerivedValue(raw, mask)) continue;
|
|
28190
|
+
if (unresolved(raw)) {
|
|
28191
|
+
if (physicalId === void 0) continue;
|
|
28192
|
+
add(spelling);
|
|
28193
|
+
} else {
|
|
28194
|
+
add(raw);
|
|
28195
|
+
if (raw.toLowerCase() !== raw && raw.length >= 4) add(raw.toLowerCase());
|
|
28196
|
+
}
|
|
28197
|
+
}
|
|
28198
|
+
const properties = record?.properties;
|
|
28199
|
+
const path = properties !== null && typeof properties === "object" && Object.hasOwn(properties, "Path") ? properties["Path"] : void 0;
|
|
28200
|
+
if (physicalId !== void 0 && isSecretDerivedValue(path, mask)) add(physicalId);
|
|
28201
|
+
const embedded = options === void 0 ? secrets : options.embedded;
|
|
28202
|
+
const embeddedBag = embedded !== void 0 && hasMaskableValues(embedded) ? embedded : void 0;
|
|
28203
|
+
if (embeddedBag !== void 0 && physicalId !== void 0) {
|
|
28204
|
+
for (const needle of printingCorpusOf(embeddedBag).keys()) if (needle !== "" && (needle === physicalId || needle.length >= 4 && physicalId.includes(needle))) add(needle);
|
|
28205
|
+
}
|
|
28206
|
+
return needles.size > 0 ? needles : void 0;
|
|
28207
|
+
}
|
|
28208
|
+
function secretNamesReadBy(logicalId, record, resources, judge = () => ({
|
|
28209
|
+
secrets: void 0,
|
|
28210
|
+
embedded: void 0
|
|
28211
|
+
})) {
|
|
28212
|
+
const read = /* @__PURE__ */ new Set();
|
|
28213
|
+
const leaves = [...wholeStringLeavesOf(record?.properties)].filter((leaf) => leaf !== "");
|
|
28214
|
+
if (leaves.length === 0) return read;
|
|
28215
|
+
for (const [otherId, other] of Object.entries(resources)) {
|
|
28216
|
+
if (otherId === logicalId) continue;
|
|
28217
|
+
const bags = judge(otherId);
|
|
28218
|
+
const needles = secretNameNeedlesOf(otherId, other, bags.secrets, { embedded: bags.embedded });
|
|
28219
|
+
if (needles === void 0) continue;
|
|
28220
|
+
for (const needle of needles) if (leaves.some((leaf) => leaf === needle || needle.length >= 4 && leaf.includes(needle))) read.add(needle);
|
|
28221
|
+
}
|
|
28222
|
+
return read;
|
|
28223
|
+
}
|
|
28224
|
+
function stateSecretNameNeedles(resources, secrets) {
|
|
28225
|
+
return (logicalId) => secretNameNeedlesOf(logicalId, Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0, secrets, { embedded: void 0 });
|
|
28226
|
+
}
|
|
28227
|
+
function secretNamePrintingBag(logicalId, resources) {
|
|
28228
|
+
const bag = /* @__PURE__ */ new Map();
|
|
28229
|
+
const record = Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0;
|
|
28230
|
+
for (const needle of secretNameNeedlesOf(logicalId, record, void 0) ?? []) recordLogOnlyValue(bag, needle);
|
|
28231
|
+
for (const needle of secretNamesReadBy(logicalId, record, resources)) recordLogOnlyValue(bag, needle);
|
|
28232
|
+
return bag;
|
|
28233
|
+
}
|
|
28234
|
+
function journaledOrphanPrintingBag(ops, stateResources) {
|
|
28235
|
+
const bag = /* @__PURE__ */ new Map();
|
|
28236
|
+
for (const op of ops) {
|
|
28237
|
+
const record = {
|
|
28238
|
+
resourceType: op.resourceType,
|
|
28239
|
+
physicalId: op.physicalId,
|
|
28240
|
+
properties: op.attemptedProperties
|
|
28241
|
+
};
|
|
28242
|
+
const replaced = Object.hasOwn(stateResources, op.logicalId) ? stateResources[op.logicalId] : void 0;
|
|
28243
|
+
for (const needle of [
|
|
28244
|
+
...secretNameNeedlesOf(op.logicalId, record, void 0) ?? [],
|
|
28245
|
+
...secretNameNeedlesOf(op.logicalId, replaced, void 0) ?? [],
|
|
28246
|
+
...secretNamesReadBy(op.logicalId, record, stateResources)
|
|
28247
|
+
]) recordLogOnlyValue(bag, needle);
|
|
28248
|
+
}
|
|
28249
|
+
return bag;
|
|
28250
|
+
}
|
|
28251
|
+
function completedReplayEntries(ops) {
|
|
28252
|
+
return ops.flatMap((op) => [{
|
|
28253
|
+
logicalId: op.logicalId,
|
|
28254
|
+
resourceType: op.resourceType,
|
|
28255
|
+
physicalId: op.physicalId,
|
|
28256
|
+
properties: op.properties,
|
|
28257
|
+
attemptedProperties: op.properties
|
|
28258
|
+
}, ...op.previousState === void 0 ? [] : [{
|
|
28259
|
+
logicalId: op.logicalId,
|
|
28260
|
+
resourceType: op.previousState.resourceType,
|
|
28261
|
+
physicalId: op.previousState.physicalId,
|
|
28262
|
+
properties: op.previousState.properties,
|
|
28263
|
+
attemptedProperties: op.previousState.properties
|
|
28264
|
+
}]]);
|
|
28265
|
+
}
|
|
28266
|
+
function orphanRecordsPrintingBag(records) {
|
|
28267
|
+
const bag = /* @__PURE__ */ new Map();
|
|
28268
|
+
for (const entry of records) {
|
|
28269
|
+
if (entry === null || typeof entry !== "object") continue;
|
|
28270
|
+
const { logicalId, state } = entry;
|
|
28271
|
+
if (typeof logicalId !== "string" || state === null || typeof state !== "object") continue;
|
|
28272
|
+
for (const needle of secretNameNeedlesOf(logicalId, state, void 0) ?? []) recordLogOnlyValue(bag, needle);
|
|
28273
|
+
}
|
|
28274
|
+
return bag;
|
|
28275
|
+
}
|
|
28276
|
+
const ORPHAN_COMMAND_LABEL = "To orphan it: ";
|
|
28277
|
+
function maskEventTextWithBoundBags(event) {
|
|
28278
|
+
if (event.reason === void 0 && event.error === void 0) return event;
|
|
28279
|
+
const mask = currentLogLineMasker();
|
|
28280
|
+
if (mask === void 0) return event;
|
|
28281
|
+
const masked = { ...event };
|
|
28282
|
+
if (masked.error?.message) {
|
|
28283
|
+
const message = masked.error.ownLines === true ? masked.error.message.split("\n").map((line) => line.startsWith(ORPHAN_COMMAND_LABEL) ? line : mask(line)).join("\n") : mask(masked.error.message);
|
|
28284
|
+
masked.error = {
|
|
28285
|
+
...masked.error,
|
|
28286
|
+
message
|
|
28287
|
+
};
|
|
28288
|
+
}
|
|
28289
|
+
if (masked.reason) masked.reason = mask(masked.reason);
|
|
28290
|
+
return masked;
|
|
28291
|
+
}
|
|
28292
|
+
|
|
28293
|
+
//#endregion
|
|
28294
|
+
//#region src/deployment/update-outcome.ts
|
|
28295
|
+
function updatePartialReason(result) {
|
|
28296
|
+
if (!result || result.outcome !== "partial") return void 0;
|
|
28297
|
+
if (typeof result.reason !== "string") return UNSPECIFIED_PARTIAL_REASON;
|
|
28298
|
+
const trimmed = result.reason.trim();
|
|
28299
|
+
return trimmed === "" ? UNSPECIFIED_PARTIAL_REASON : trimmed;
|
|
28300
|
+
}
|
|
28301
|
+
const UNSPECIFIED_PARTIAL_REASON = "provider reported a partial update without a reason";
|
|
28302
|
+
function updatePartialMessage(reason) {
|
|
28303
|
+
return `partial (${reason})`;
|
|
28304
|
+
}
|
|
28305
|
+
|
|
28306
|
+
//#endregion
|
|
28307
|
+
//#region src/provisioning/redacted-delete-address.ts
|
|
28308
|
+
function isRedactedRecordedValue(value) {
|
|
28309
|
+
if (carriesSecretMask(value)) return true;
|
|
28310
|
+
let text;
|
|
28311
|
+
try {
|
|
28312
|
+
text = typeof value === "string" ? value : JSON.stringify(value);
|
|
28313
|
+
} catch {
|
|
28314
|
+
return false;
|
|
28315
|
+
}
|
|
28316
|
+
return text !== void 0 && dynamicReferenceTokens(text).length > 0;
|
|
28317
|
+
}
|
|
28318
|
+
const REDACTED_DELETE_ADDRESS_SKIP_REASON = "redacted address property in state — no delete issued";
|
|
28319
|
+
function redactedDeleteAddressFields(fields) {
|
|
28320
|
+
return Object.keys(fields).filter((key) => isRedactedRecordedValue(fields[key]));
|
|
28321
|
+
}
|
|
28322
|
+
function redactedDeleteAddressSkip(logger, logicalId, what, redactedFields, context) {
|
|
28323
|
+
if (redactedFields.length === 0) return void 0;
|
|
28324
|
+
logger.warn(safeMsg`${what} ${logicalId} is recorded in state with ${redactedFields.join(", ")} ` + "redacted (the '***' mask of a NoEcho value it read, or a secret '{{resolve:...}}' reference), which names nothing in AWS; skipping deletion — no AWS call is issued, so the resource is LEFT IN PLACE unless a parent resource this run also deletes removes it (then only the record is stale). Re-deploying records the same redaction again. The state record is KEPT and the run reports the skip: on 'cdkd destroy' / 'cdkd state destroy' (which exits non-zero) and, since issue 1762, on the plain DELETE of a resource removed from the template during cdkd deploy. Remove the resource by hand, " + safeMsg`then drop the record with ${stateOrphanRecordRemedy(context, logicalId)}. ` + "NOTE a deploy-side REPLACEMENT or rollback delete instead FAILS the resource (https://github.com/go-to-k/cdkd/issues/1762) — the old resource is left untracked there, so remove it by hand.");
|
|
28325
|
+
return {
|
|
28326
|
+
outcome: "skipped",
|
|
28327
|
+
reason: REDACTED_DELETE_ADDRESS_SKIP_REASON
|
|
28328
|
+
};
|
|
28329
|
+
}
|
|
28330
|
+
|
|
28132
28331
|
//#endregion
|
|
28133
28332
|
//#region src/deployment/rollback-executor/replay-inline-policy-restore.ts
|
|
28134
28333
|
async function restoreHeldInlinePolicies(writers, stateResources, stackName, ctx, result, options = {}) {
|
|
@@ -28437,6 +28636,15 @@ function classifyRollbackOp(op, stateResources, orphanLogicalIds) {
|
|
|
28437
28636
|
oldProperties: op.previousState.properties,
|
|
28438
28637
|
newProperties: current.properties
|
|
28439
28638
|
})) return "skip-already-done";
|
|
28639
|
+
const retainedOld = op.oldResourceRetained ?? op.previousState.updateReplacePolicy === "Retain";
|
|
28640
|
+
if (rollbackCannotAddress(current, op.resourceType, current.provisionedBy ?? op.provisionedBy, current.physicalId)) {
|
|
28641
|
+
if (!resolveReplacementOldType(op).ok) return "refuse-replacement-routing";
|
|
28642
|
+
return retainedOld ? "reverse-replacement-readopt" : "reverse-replacement";
|
|
28643
|
+
}
|
|
28644
|
+
if (retainedOld && op.physicalId !== void 0 && !hasAddressablePhysicalId(op)) {
|
|
28645
|
+
if (!resolveReplacementOldType(op).ok) return "refuse-replacement-routing";
|
|
28646
|
+
return "reverse-replacement-readopt";
|
|
28647
|
+
}
|
|
28440
28648
|
if (op.physicalId !== void 0 && current.physicalId !== op.physicalId) {
|
|
28441
28649
|
if (sameTypeAsOld && deepEqual$1(current.properties, op.previousState.properties)) return "skip-already-done";
|
|
28442
28650
|
return "skip-mismatch";
|
|
@@ -28456,7 +28664,7 @@ function classifyFailedOp(op, stateResources, siblings = []) {
|
|
|
28456
28664
|
if (op.physicalIdRecoveredFromError === true) {
|
|
28457
28665
|
if (current) {
|
|
28458
28666
|
if (current.physicalId === op.physicalId) return "skip-failed-noop";
|
|
28459
|
-
if (!isReplacedRecord(op, current)) return "skip-failed-mismatch";
|
|
28667
|
+
if (!isReplacedRecord(op, current) && !isProvenDistinctRecord(op, current)) return "skip-failed-mismatch";
|
|
28460
28668
|
}
|
|
28461
28669
|
if (stateHoldsPhysicalId(stateResources, op.resourceType, op.physicalId)) return "skip-failed-noop";
|
|
28462
28670
|
const orphanPolicy = effectiveDeletionPolicy(op.resourceType, op.deletionPolicy, op.attemptedProperties);
|
|
@@ -28483,7 +28691,21 @@ function isReplacedRecord(op, record) {
|
|
|
28483
28691
|
return isReplacementOrphan(op) && record !== void 0 && record.physicalId === op.replacedPhysicalId && record.resourceType === op.replacedResourceType;
|
|
28484
28692
|
}
|
|
28485
28693
|
function failedOpOwnRecord(op, stateResources) {
|
|
28486
|
-
return
|
|
28694
|
+
return recordUnderIdIsNotOwn(op, stateResources) ? void 0 : stateResources[op.logicalId];
|
|
28695
|
+
}
|
|
28696
|
+
const provenDistinctFrom = /* @__PURE__ */ new WeakMap();
|
|
28697
|
+
function markProvenDistinctFromRecord(op, record) {
|
|
28698
|
+
provenDistinctFrom.set(op, {
|
|
28699
|
+
physicalId: record.physicalId,
|
|
28700
|
+
resourceType: record.resourceType
|
|
28701
|
+
});
|
|
28702
|
+
}
|
|
28703
|
+
function isProvenDistinctRecord(op, record) {
|
|
28704
|
+
const verdict = provenDistinctFrom.get(op);
|
|
28705
|
+
return verdict !== void 0 && record !== void 0 && record.physicalId === verdict.physicalId && record.resourceType === verdict.resourceType;
|
|
28706
|
+
}
|
|
28707
|
+
function recordUnderIdIsNotOwn(op, stateResources) {
|
|
28708
|
+
return isReplacementOrphan(op) || isProvenDistinctRecord(op, Object.hasOwn(stateResources, op.logicalId) ? stateResources[op.logicalId] : void 0);
|
|
28487
28709
|
}
|
|
28488
28710
|
function replacementNeverSwapped(op, siblings) {
|
|
28489
28711
|
return siblings.some((s) => s !== op && isReplacementOrphan(s) && s.logicalId === op.logicalId && s.replacedPhysicalId === op.physicalId);
|
|
@@ -28764,6 +28986,10 @@ async function replayDelete(s) {
|
|
|
28764
28986
|
return;
|
|
28765
28987
|
}
|
|
28766
28988
|
const deleteProvisionedBy = effectiveProvisionedBy(stateResources[op.logicalId], op.provisionedBy);
|
|
28989
|
+
if (rollbackCannotAddress(stateResources[op.logicalId], op.resourceType, deleteProvisionedBy, op.physicalId)) {
|
|
28990
|
+
skipUnaddressableReplay(s, logger, op, "delete created resource");
|
|
28991
|
+
return;
|
|
28992
|
+
}
|
|
28767
28993
|
s.createRollbackRoute = deleteProvisionedBy;
|
|
28768
28994
|
const snapshotPolicy = action === "delete-with-final-snapshot";
|
|
28769
28995
|
const takeFinalSnapshot = snapshotPolicy && ctx.skipFinalSnapshot !== true;
|
|
@@ -28809,10 +29035,24 @@ async function replayReadopt(s) {
|
|
|
28809
29035
|
const { op, stateResources, stackName, ctx, result, inlinePolicyWriters, afterOp, logger, mask } = s;
|
|
28810
29036
|
const current = stateResources[op.logicalId];
|
|
28811
29037
|
const prev = op.previousState;
|
|
29038
|
+
const oldShown = hasAddressablePhysicalId({ physicalId: prev.physicalId }) ? displaySafe(mask(prev.physicalId)) : "no recorded id";
|
|
29039
|
+
const unprovenCopyRefusal = (reason) => {
|
|
29040
|
+
const remedy = orphanRemedy(op.logicalId, ctx);
|
|
29041
|
+
return ownRemedyError(markNonRetryable(new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + reason + ` The retained old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. Check both resources by hand.` + (remedy.offered ? ` To leave this one as it is, re-run ${rerunRollbackPhrase(ctx, "`cdkd rollback`")} with the command below; that also drops the journal's only record of the retained old resource (${oldShown}), so note that id first.` : ` No repair of the state record makes this op succeed on a re-run.`) + remedy.clause + remedy.line, STATE_RESOURCES_MALFORMED)));
|
|
29042
|
+
};
|
|
29043
|
+
const opIdUnusable = op.physicalId !== void 0 && !hasAddressablePhysicalId(op);
|
|
29044
|
+
if (!rollbackRetainsNewResource(current) && rollbackCannotAddress(current, op.resourceType, current.provisionedBy ?? op.provisionedBy, current.physicalId)) {
|
|
29045
|
+
if (opIdUnusable) throw unprovenCopyRefusal("neither its state record nor its rollback journal entry has a non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot address that resource in AWS or tell which resource it is, and sent nothing.");
|
|
29046
|
+
const target = op.physicalId === void 0 ? void 0 : refusalPhysicalId(mask(String(op.physicalId)));
|
|
29047
|
+
const repair = target === void 0 ? `Repair the record's 'physicalId' to the id of the replacement's NEW resource (inspect it with \`cdkd state show\`): the journal does not record that id, and the re-run DELETES the resource the repaired record names as the new copy, so name the right one. Then re-run ${rerunRollbackPhrase(ctx, "`cdkd rollback`")}.` : `Repair the record's 'physicalId' to ${target}, the replacement's new resource the journal records (inspect it with \`cdkd state show\`); the re-run deletes it and re-adopts the old one. Any other id stops the revert and drops the journal's only record of the retained old resource (${oldShown}). Then re-run ${rerunRollbackPhrase(ctx, "`cdkd rollback`")}.` + (describedPhysicalIdPointer(target) !== "" ? " That id is left out of the prose above: it is not a plain identifier — read it from the rollback journal." : target.includes("***") ? ` That id is shown masked — read the full value from the rollback journal.` : "");
|
|
29048
|
+
throw new CdkdError(safeMsg`Cannot reverse the replacement of ${shownLogicalId(op.logicalId)} (${refusalResourceType(op.resourceType)}): ` + `its state record has no non-empty string 'physicalId', so cdkd cannot address the new resource in AWS to delete it, and sent nothing. The retained old resource (${oldShown}) is named only by the rollback journal, so the JOURNAL is kept. ` + repair, STATE_RESOURCES_MALFORMED);
|
|
29049
|
+
}
|
|
29050
|
+
if (!rollbackRetainsNewResource(current) && opIdUnusable && current.physicalId !== op.physicalId) throw unprovenCopyRefusal("its rollback journal entry has no non-empty string 'physicalId' for the replacement's new resource, so cdkd cannot tell whether the resource state records under this id is that one, and did not delete it; nothing was sent.");
|
|
28812
29051
|
logger.info(` Rollback: Reversing replacement of ${safe(op.logicalId)} (${safe(op.resourceType)}) — deleting the new resource and re-adopting the retained old one (${displaySafe(mask(prev.physicalId))})`);
|
|
28813
29052
|
let survivorReason;
|
|
29053
|
+
const survivorId = retainedSurvivorId(current, op);
|
|
28814
29054
|
if (rollbackRetainsNewResource(current)) {
|
|
28815
|
-
const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType,
|
|
29055
|
+
const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId ?? "no recorded id", `State is restored to the old resource (${prev.physicalId}).`, mask);
|
|
28816
29056
|
logger.warn(survivorMessages.warn);
|
|
28817
29057
|
survivorReason = survivorMessages.reason;
|
|
28818
29058
|
result.warnings++;
|
|
@@ -28850,7 +29090,7 @@ async function replayReadopt(s) {
|
|
|
28850
29090
|
resourceType: op.resourceType,
|
|
28851
29091
|
...op.provisionedBy && { provisionedBy: op.provisionedBy },
|
|
28852
29092
|
...survivorReason !== void 0 && {
|
|
28853
|
-
physicalId:
|
|
29093
|
+
...survivorId !== void 0 && { physicalId: survivorId },
|
|
28854
29094
|
reason: mask(survivorReason),
|
|
28855
29095
|
...survivorProvisionedBy && { provisionedBy: survivorProvisionedBy }
|
|
28856
29096
|
}
|
|
@@ -28879,6 +29119,10 @@ async function replayRevert(s) {
|
|
|
28879
29119
|
recordRollbackSkip(s, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
28880
29120
|
return;
|
|
28881
29121
|
}
|
|
29122
|
+
if (rollbackCannotAddress(current, op.resourceType, op.provisionedBy, current.physicalId)) {
|
|
29123
|
+
skipUnaddressableReplay(s, logger, op, "restore");
|
|
29124
|
+
return;
|
|
29125
|
+
}
|
|
28882
29126
|
logger.info(` Rollback: Restoring ${safe(op.logicalId)} (${safe(op.resourceType)}) to previous state`);
|
|
28883
29127
|
const { provider, provisionedBy: revertVia } = ctx.providerRegistry.getProviderFor({
|
|
28884
29128
|
resourceType: op.resourceType,
|
|
@@ -28958,6 +29202,10 @@ async function replayReverseReplacement(s) {
|
|
|
28958
29202
|
recordRollbackSkip(s, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
28959
29203
|
return;
|
|
28960
29204
|
}
|
|
29205
|
+
if (!rollbackRetainsNewResource(current) && rollbackCannotAddress(current, op.resourceType, current.provisionedBy ?? op.provisionedBy, current.physicalId)) {
|
|
29206
|
+
skipUnaddressableReplay(s, logger, op, "reverse the replacement of");
|
|
29207
|
+
return;
|
|
29208
|
+
}
|
|
28961
29209
|
const resolvedPrevProps = await resolveReplayProps(prev.properties, resolver, secrets, ctx, op.logicalId) ?? {};
|
|
28962
29210
|
refuseMaskedReplayBaseline(resolvedPrevProps, op.logicalId);
|
|
28963
29211
|
opMasker.addNamed({
|
|
@@ -29100,8 +29348,9 @@ async function replayReverseReplacement(s) {
|
|
|
29100
29348
|
if (!adoptedLiveNewResource) inlinePolicyWriters.record(op.logicalId, "create", stateResources[op.logicalId], false, createProvisionedBy);
|
|
29101
29349
|
await afterOp?.(op.logicalId);
|
|
29102
29350
|
let survivorReason;
|
|
29351
|
+
const survivorId = retainedSurvivorId(current, op);
|
|
29103
29352
|
if (!deletedNewFirst && !adoptedLiveNewResource && rollbackRetainsNewResource(current)) {
|
|
29104
|
-
const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType,
|
|
29353
|
+
const survivorMessages = retainedSurvivorMessages(op.logicalId, op.resourceType, survivorId ?? "no recorded id", `State records the re-created old resource (${stateResources[op.logicalId]?.physicalId ?? prev.physicalId}).`, mask);
|
|
29105
29354
|
logger.warn(survivorMessages.warn);
|
|
29106
29355
|
survivorReason = survivorMessages.reason;
|
|
29107
29356
|
result.warnings++;
|
|
@@ -29133,7 +29382,7 @@ async function replayReverseReplacement(s) {
|
|
|
29133
29382
|
resourceType: op.resourceType,
|
|
29134
29383
|
...op.provisionedBy && { provisionedBy: op.provisionedBy },
|
|
29135
29384
|
...survivorReason !== void 0 && {
|
|
29136
|
-
physicalId:
|
|
29385
|
+
...survivorId !== void 0 && { physicalId: survivorId },
|
|
29137
29386
|
reason: mask(survivorReason),
|
|
29138
29387
|
...survivorProvisionedBy && { provisionedBy: survivorProvisionedBy }
|
|
29139
29388
|
},
|
|
@@ -29420,7 +29669,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
29420
29669
|
result.orphaned.push(orphaned);
|
|
29421
29670
|
options.onOrphan?.(orphaned);
|
|
29422
29671
|
}
|
|
29423
|
-
if (!
|
|
29672
|
+
if (!recordUnderIdIsNotOwn(op, stateResources)) delete stateResources[op.logicalId];
|
|
29424
29673
|
await noteRetainedResource(op.resourceType, op.logicalId);
|
|
29425
29674
|
logger.info(` Rollback: leaving partially-created ${safe(op.logicalId)} (${safe(op.resourceType)}) in AWS (DeletionPolicy: Retain)` + (failedCreateRecord ? " — removed from state" : " — it was never in state"));
|
|
29426
29675
|
await options.afterOp?.(op.logicalId);
|
|
@@ -29438,6 +29687,10 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
29438
29687
|
case "delete-failed-create-with-final-snapshot": {
|
|
29439
29688
|
const failedCreateRecord = failedOpOwnRecord(op, stateResources);
|
|
29440
29689
|
const deleteProvisionedBy = effectiveProvisionedBy(failedCreateRecord, op.provisionedBy);
|
|
29690
|
+
if (rollbackCannotAddress(failedCreateRecord, op.resourceType, deleteProvisionedBy, op.physicalId)) {
|
|
29691
|
+
skipUnaddressableReplay(skipScope, logger, op, "delete partially-created resource", failedCreateRecord ? "record" : "journal");
|
|
29692
|
+
break;
|
|
29693
|
+
}
|
|
29441
29694
|
createRollbackRoute = deleteProvisionedBy;
|
|
29442
29695
|
const snapshotPolicy = action === "delete-failed-create-with-final-snapshot";
|
|
29443
29696
|
const takeFinalSnapshot = snapshotPolicy && ctx.skipFinalSnapshot !== true;
|
|
@@ -29475,7 +29728,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
29475
29728
|
result.warnings++;
|
|
29476
29729
|
result.leftInPlace++;
|
|
29477
29730
|
}
|
|
29478
|
-
if (!
|
|
29731
|
+
if (!recordUnderIdIsNotOwn(op, stateResources)) delete stateResources[op.logicalId];
|
|
29479
29732
|
await options.afterOp?.(op.logicalId);
|
|
29480
29733
|
ctx.recordEvent?.({
|
|
29481
29734
|
eventType: "ROLLBACK_RESOURCE_SUCCEEDED",
|
|
@@ -29499,6 +29752,10 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
29499
29752
|
recordRollbackSkip(skipScope, op, ABSENT_BASELINE_SKIP_CAUSE);
|
|
29500
29753
|
break;
|
|
29501
29754
|
}
|
|
29755
|
+
if (rollbackCannotAddress(current, op.resourceType, op.provisionedBy ?? current.provisionedBy, current.physicalId)) {
|
|
29756
|
+
skipUnaddressableReplay(skipScope, logger, op, "force-revert failed UPDATE of");
|
|
29757
|
+
break;
|
|
29758
|
+
}
|
|
29502
29759
|
logger.info(` Rollback: force-reverting failed UPDATE of ${safe(op.logicalId)} (${safe(op.resourceType)}) to its pre-deploy properties (--revert-failed; remote state is unknown)`);
|
|
29503
29760
|
const { provider, provisionedBy: revertVia } = ctx.providerRegistry.getProviderFor({
|
|
29504
29761
|
resourceType: op.resourceType,
|
|
@@ -29575,7 +29832,7 @@ async function replayFailedOperationsUnbound(failedOps, stateResources, stackNam
|
|
|
29575
29832
|
error: maskedRollbackEventError(revertError, mask)
|
|
29576
29833
|
});
|
|
29577
29834
|
}
|
|
29578
|
-
inlinePolicyWriters.noteOutcome(op, action === "skip-failed-noop" || action === "skip-failed-mismatch" || action === "skip-failed-superseded" || action === "skip-failed-replaced-deleted" || ownRecord(stateResources, op.logicalId) !== recordBefore ||
|
|
29835
|
+
inlinePolicyWriters.noteOutcome(op, action === "skip-failed-noop" || action === "skip-failed-mismatch" || action === "skip-failed-superseded" || action === "skip-failed-replaced-deleted" || ownRecord(stateResources, op.logicalId) !== recordBefore || recordUnderIdIsNotOwn(op, stateResources) && !pending.has(op) && (action === "delete-failed-create" || action === "delete-failed-create-with-final-snapshot" || action === "orphan-failed-create-retain"));
|
|
29579
29836
|
}
|
|
29580
29837
|
if (result.interrupted) await restoreHeldInlinePolicies(inlinePolicyWriters, stateResources, stackName, ctx, result, { refuseAll: true });
|
|
29581
29838
|
if (emitEnvelope) ctx.recordEvent?.({
|
|
@@ -29861,7 +30118,7 @@ async function revertNestedChildFromJournal(args) {
|
|
|
29861
30118
|
providerRegistry: ctx.providerRegistry,
|
|
29862
30119
|
region,
|
|
29863
30120
|
logger,
|
|
29864
|
-
...ctx.options?.eventRecorder && { recordEvent: (event) => ctx.options.eventRecorder.record(event) },
|
|
30121
|
+
...ctx.options?.eventRecorder && { recordEvent: (event) => ctx.options.eventRecorder.record(maskEventTextWithBoundBags(event)) },
|
|
29865
30122
|
finalSnapshotClients: ctx.options?.finalSnapshotClients,
|
|
29866
30123
|
skipFinalSnapshot: ctx.options?.skipFinalSnapshot === true || ctx.destroyOptions?.skipFinalSnapshot === true,
|
|
29867
30124
|
importedProducerRegions: producerRegions.regions,
|
|
@@ -29883,11 +30140,11 @@ async function revertNestedChildFromJournal(args) {
|
|
|
29883
30140
|
const skipPrefix = segment.skipPrefix ?? getCurrentSkipPrefix();
|
|
29884
30141
|
const split = splitImportedOps(segment.operations, segment);
|
|
29885
30142
|
const result = await withNestedStackContext(childCtx, () => withSkipPrefix(skipPrefix, () => withStackName(childStackName, () => withCreateTokenLedger(ledgerForStack(ctx.stateBackend, childStackName, region), () => withNestedRevertRun(runId, async (inner) => {
|
|
29886
|
-
const replayed = await replayRollback(split.replay, stateResources, childStackName, execCtx, {
|
|
30143
|
+
const replayed = await withPrintingSecrets(journaledOrphanPrintingBag(completedReplayEntries(split.replay), stateResources), () => replayRollback(split.replay, stateResources, childStackName, execCtx, {
|
|
29887
30144
|
afterOp: save,
|
|
29888
30145
|
onOrphan: (record) => mintedOrphans.push(record),
|
|
29889
30146
|
inlinePolicyWriters
|
|
29890
|
-
});
|
|
30147
|
+
}));
|
|
29891
30148
|
for (const [id, below] of inner.settled) settledBelow.set(id, below);
|
|
29892
30149
|
return {
|
|
29893
30150
|
...replayed,
|
|
@@ -30053,105 +30310,6 @@ function makeSiblingClaimReader(params) {
|
|
|
30053
30310
|
};
|
|
30054
30311
|
}
|
|
30055
30312
|
|
|
30056
|
-
//#endregion
|
|
30057
|
-
//#region src/deployment/secret-name-needles.ts
|
|
30058
|
-
function secretNameNeedlesOf(logicalId, record, secrets, options) {
|
|
30059
|
-
const physicalId = typeof record?.physicalId === "string" && record.physicalId !== "" ? record.physicalId : void 0;
|
|
30060
|
-
const bag = secrets !== void 0 && hasMaskableValues(secrets) ? secrets : void 0;
|
|
30061
|
-
const mask = (text) => bag === void 0 ? text : maskSecretsInText(text, bag);
|
|
30062
|
-
const unresolved = (value) => value.includes("{{resolve:") || value === "***";
|
|
30063
|
-
const named = {
|
|
30064
|
-
resourceType: record?.resourceType,
|
|
30065
|
-
properties: record?.properties,
|
|
30066
|
-
logicalId
|
|
30067
|
-
};
|
|
30068
|
-
const needles = /* @__PURE__ */ new Set();
|
|
30069
|
-
const add = (needle) => {
|
|
30070
|
-
if (typeof needle === "string" && needle !== "") needles.add(needle);
|
|
30071
|
-
};
|
|
30072
|
-
for (const [raw, derived] of secretDerivedNamePairs({
|
|
30073
|
-
...named,
|
|
30074
|
-
physicalIds: []
|
|
30075
|
-
})) if (typeof raw === "string" && !unresolved(raw) && isSecretDerivedValue(raw, mask)) add(derived);
|
|
30076
|
-
for (const [raw, spelling] of secretDerivedNamePairs({
|
|
30077
|
-
...named,
|
|
30078
|
-
physicalIds: [physicalId ?? "cdkd-no-physical-id-yet"]
|
|
30079
|
-
})) {
|
|
30080
|
-
if (!isSecretDerivedValue(raw, mask)) continue;
|
|
30081
|
-
if (unresolved(raw)) {
|
|
30082
|
-
if (physicalId === void 0) continue;
|
|
30083
|
-
add(spelling);
|
|
30084
|
-
} else {
|
|
30085
|
-
add(raw);
|
|
30086
|
-
if (raw.toLowerCase() !== raw && raw.length >= 4) add(raw.toLowerCase());
|
|
30087
|
-
}
|
|
30088
|
-
}
|
|
30089
|
-
const properties = record?.properties;
|
|
30090
|
-
const path = properties !== null && typeof properties === "object" && Object.hasOwn(properties, "Path") ? properties["Path"] : void 0;
|
|
30091
|
-
if (physicalId !== void 0 && isSecretDerivedValue(path, mask)) add(physicalId);
|
|
30092
|
-
const embedded = options === void 0 ? secrets : options.embedded;
|
|
30093
|
-
const embeddedBag = embedded !== void 0 && hasMaskableValues(embedded) ? embedded : void 0;
|
|
30094
|
-
if (embeddedBag !== void 0 && physicalId !== void 0) {
|
|
30095
|
-
for (const needle of printingCorpusOf(embeddedBag).keys()) if (needle !== "" && (needle === physicalId || needle.length >= 4 && physicalId.includes(needle))) add(needle);
|
|
30096
|
-
}
|
|
30097
|
-
return needles.size > 0 ? needles : void 0;
|
|
30098
|
-
}
|
|
30099
|
-
function secretNamesReadBy(logicalId, record, resources, judge = () => ({
|
|
30100
|
-
secrets: void 0,
|
|
30101
|
-
embedded: void 0
|
|
30102
|
-
})) {
|
|
30103
|
-
const read = /* @__PURE__ */ new Set();
|
|
30104
|
-
const leaves = [...wholeStringLeavesOf(record?.properties)].filter((leaf) => leaf !== "");
|
|
30105
|
-
if (leaves.length === 0) return read;
|
|
30106
|
-
for (const [otherId, other] of Object.entries(resources)) {
|
|
30107
|
-
if (otherId === logicalId) continue;
|
|
30108
|
-
const bags = judge(otherId);
|
|
30109
|
-
const needles = secretNameNeedlesOf(otherId, other, bags.secrets, { embedded: bags.embedded });
|
|
30110
|
-
if (needles === void 0) continue;
|
|
30111
|
-
for (const needle of needles) if (leaves.some((leaf) => leaf === needle || needle.length >= 4 && leaf.includes(needle))) read.add(needle);
|
|
30112
|
-
}
|
|
30113
|
-
return read;
|
|
30114
|
-
}
|
|
30115
|
-
function stateSecretNameNeedles(resources, secrets) {
|
|
30116
|
-
return (logicalId) => secretNameNeedlesOf(logicalId, Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0, secrets, { embedded: void 0 });
|
|
30117
|
-
}
|
|
30118
|
-
function secretNamePrintingBag(logicalId, resources) {
|
|
30119
|
-
const bag = /* @__PURE__ */ new Map();
|
|
30120
|
-
const record = Object.hasOwn(resources, logicalId) ? resources[logicalId] : void 0;
|
|
30121
|
-
for (const needle of secretNameNeedlesOf(logicalId, record, void 0) ?? []) recordLogOnlyValue(bag, needle);
|
|
30122
|
-
for (const needle of secretNamesReadBy(logicalId, record, resources)) recordLogOnlyValue(bag, needle);
|
|
30123
|
-
return bag;
|
|
30124
|
-
}
|
|
30125
|
-
function journaledOrphanPrintingBag(ops, stateResources) {
|
|
30126
|
-
const bag = /* @__PURE__ */ new Map();
|
|
30127
|
-
for (const op of ops) {
|
|
30128
|
-
const record = {
|
|
30129
|
-
resourceType: op.resourceType,
|
|
30130
|
-
physicalId: op.physicalId,
|
|
30131
|
-
properties: op.attemptedProperties
|
|
30132
|
-
};
|
|
30133
|
-
const replaced = Object.hasOwn(stateResources, op.logicalId) ? stateResources[op.logicalId] : void 0;
|
|
30134
|
-
for (const needle of [
|
|
30135
|
-
...secretNameNeedlesOf(op.logicalId, record, void 0) ?? [],
|
|
30136
|
-
...secretNameNeedlesOf(op.logicalId, replaced, void 0) ?? [],
|
|
30137
|
-
...secretNamesReadBy(op.logicalId, record, stateResources)
|
|
30138
|
-
]) recordLogOnlyValue(bag, needle);
|
|
30139
|
-
}
|
|
30140
|
-
return bag;
|
|
30141
|
-
}
|
|
30142
|
-
function maskEventTextWithBoundBags(event) {
|
|
30143
|
-
if (event.reason === void 0 && event.error === void 0) return event;
|
|
30144
|
-
const mask = currentLogLineMasker();
|
|
30145
|
-
if (mask === void 0) return event;
|
|
30146
|
-
const masked = { ...event };
|
|
30147
|
-
if (masked.error?.message && masked.error.ownLines !== true) masked.error = {
|
|
30148
|
-
...masked.error,
|
|
30149
|
-
message: mask(masked.error.message)
|
|
30150
|
-
};
|
|
30151
|
-
if (masked.reason) masked.reason = mask(masked.reason);
|
|
30152
|
-
return masked;
|
|
30153
|
-
}
|
|
30154
|
-
|
|
30155
30313
|
//#endregion
|
|
30156
30314
|
//#region src/deployment/rollback-executor/journaled-orphans.ts
|
|
30157
30315
|
const NONE = {
|
|
@@ -30284,7 +30442,7 @@ async function settleJournaledOrphansOnSuccess(args) {
|
|
|
30284
30442
|
logger.info(safeMsg`The rollback journal of stack ${stack} records ${all.length} resource(s) a failed deploy ` + `created that no state record holds; acting on them per their DeletionPolicy before the journal is removed:`);
|
|
30285
30443
|
for (const line of journaledOrphanLines(orphans, logger)) logger.info(line);
|
|
30286
30444
|
try {
|
|
30287
|
-
const { unreadable, tracked } = await applySuccessRule(orphans, stateResources, orphans.deployLogicalIds ?? /* @__PURE__ */ new Set(), args.foreignHolder, stack, logger, args.isInterrupted);
|
|
30445
|
+
const { unreadable, tracked } = await applySuccessRule(orphans, stateResources, orphans.deployLogicalIds ?? /* @__PURE__ */ new Set(), args.foreignHolder, stack, logger, args.isInterrupted, ctx);
|
|
30288
30446
|
const acting = {
|
|
30289
30447
|
segments: orphans.segments.map(({ segment, ops }) => ({
|
|
30290
30448
|
segment,
|
|
@@ -30343,7 +30501,7 @@ async function settleJournaledOrphansOnSuccess(args) {
|
|
|
30343
30501
|
keepJournal: true
|
|
30344
30502
|
};
|
|
30345
30503
|
}
|
|
30346
|
-
async function applySuccessRule(orphans, stateResources, deployLogicalIds, foreignHolder, stack, logger, isInterrupted) {
|
|
30504
|
+
async function applySuccessRule(orphans, stateResources, deployLogicalIds, foreignHolder, stack, logger, isInterrupted, identityCtx) {
|
|
30347
30505
|
const unreadable = /* @__PURE__ */ new Set();
|
|
30348
30506
|
const tracked = /* @__PURE__ */ new Set();
|
|
30349
30507
|
let interrupted = false;
|
|
@@ -30358,9 +30516,20 @@ async function applySuccessRule(orphans, stateResources, deployLogicalIds, forei
|
|
|
30358
30516
|
tracked.add(op);
|
|
30359
30517
|
continue;
|
|
30360
30518
|
}
|
|
30361
|
-
|
|
30362
|
-
|
|
30363
|
-
|
|
30519
|
+
const hasRecord = Object.prototype.hasOwnProperty.call(stateResources, op.logicalId);
|
|
30520
|
+
const record = hasRecord ? stateResources[op.logicalId] : void 0;
|
|
30521
|
+
const recordUnderId = hasRecord && !isReplacedRecord(op, record);
|
|
30522
|
+
if (recordUnderId || deployLogicalIds.has(op.logicalId)) {
|
|
30523
|
+
const verdict = recordUnderId ? await recordIdentity(op, record, identityCtx, logger) : "unknown";
|
|
30524
|
+
if (verdict === "same") {
|
|
30525
|
+
tracked.add(op);
|
|
30526
|
+
continue;
|
|
30527
|
+
}
|
|
30528
|
+
if (verdict !== "different") {
|
|
30529
|
+
op.physicalIdRecoveredFromError = false;
|
|
30530
|
+
continue;
|
|
30531
|
+
}
|
|
30532
|
+
markProvenDistinctFromRecord(op, record);
|
|
30364
30533
|
}
|
|
30365
30534
|
const holding = await foreignHolder(op.resourceType, op.physicalId);
|
|
30366
30535
|
if (holding === void 0) continue;
|
|
@@ -30377,6 +30546,23 @@ async function applySuccessRule(orphans, stateResources, deployLogicalIds, forei
|
|
|
30377
30546
|
tracked
|
|
30378
30547
|
};
|
|
30379
30548
|
}
|
|
30549
|
+
async function recordIdentity(op, record, ctx, logger) {
|
|
30550
|
+
if (typeof record !== "object" || record === null || record.resourceType !== op.resourceType || typeof record.physicalId !== "string" || record.physicalId === "" || !op.physicalId) return "unknown";
|
|
30551
|
+
try {
|
|
30552
|
+
const { provider } = ctx.providerRegistry.getProviderFor({
|
|
30553
|
+
resourceType: op.resourceType,
|
|
30554
|
+
provisionedBy: op.provisionedBy
|
|
30555
|
+
});
|
|
30556
|
+
if (typeof provider.isSameResource !== "function") return "unknown";
|
|
30557
|
+
return await provider.isSameResource(op.physicalId, {
|
|
30558
|
+
physicalId: record.physicalId,
|
|
30559
|
+
...record.provisionedBy !== void 0 && { provisionedBy: record.provisionedBy }
|
|
30560
|
+
}, op.resourceType, { expectedRegion: ctx.region });
|
|
30561
|
+
} catch (err) {
|
|
30562
|
+
logger.debug(safeMsg`Could not compare ${logicalIdShown(op.logicalId)}'s journaled resource with its state record (${displaySafe(err instanceof Error ? err.name : typeof err)}).`);
|
|
30563
|
+
return "unknown";
|
|
30564
|
+
}
|
|
30565
|
+
}
|
|
30380
30566
|
function makeForeignHolderScan(stateBackend) {
|
|
30381
30567
|
let scan;
|
|
30382
30568
|
const key = (type, id) => JSON.stringify([type, id]);
|
|
@@ -30493,7 +30679,8 @@ function redactOperationsForJournal(operations) {
|
|
|
30493
30679
|
}
|
|
30494
30680
|
async function adoptRollbackOrphans(currentState, effectiveTemplate) {
|
|
30495
30681
|
const records = currentState.orphans ?? [];
|
|
30496
|
-
const
|
|
30682
|
+
const named = orphanRecordsPrintingBag(records);
|
|
30683
|
+
const plan = await withPrintingSecrets(named, () => planOrphanAdoption({
|
|
30497
30684
|
records,
|
|
30498
30685
|
managedLogicalIds: new Set(Object.keys(currentState.resources)),
|
|
30499
30686
|
template: effectiveTemplate,
|
|
@@ -30514,14 +30701,7 @@ async function adoptRollbackOrphans(currentState, effectiveTemplate) {
|
|
|
30514
30701
|
logger: this.logger
|
|
30515
30702
|
}),
|
|
30516
30703
|
logger: { debug: (m) => this.logger.debug(m) }
|
|
30517
|
-
});
|
|
30518
|
-
const named = /* @__PURE__ */ new Map();
|
|
30519
|
-
for (const entry of records) {
|
|
30520
|
-
if (entry === null || typeof entry !== "object") continue;
|
|
30521
|
-
const { logicalId, state } = entry;
|
|
30522
|
-
if (typeof logicalId !== "string" || state === null || typeof state !== "object") continue;
|
|
30523
|
-
for (const needle of secretNameNeedlesOf(logicalId, state, void 0) ?? []) recordLogOnlyValue(named, needle);
|
|
30524
|
-
}
|
|
30704
|
+
}));
|
|
30525
30705
|
for (const notice of plan.notices) this.logger.info(maskSecretsInText(notice, named));
|
|
30526
30706
|
if (plan.refusals.length > 0) throw new Error(`Deploy refused — cdkd left ${plan.refusals.length} resource(s) in AWS that it cannot safely re-adopt:\n ${plan.refusals.map((r) => maskSecretsInText(r, named)).join("\n ")}`);
|
|
30527
30707
|
for (const [logicalId, record] of Object.entries(plan.adopted)) {
|
|
@@ -30531,26 +30711,26 @@ async function adoptRollbackOrphans(currentState, effectiveTemplate) {
|
|
|
30531
30711
|
if (records.length > 0) currentState.orphans = plan.remaining;
|
|
30532
30712
|
return plan;
|
|
30533
30713
|
}
|
|
30534
|
-
function
|
|
30714
|
+
function replayPrintingBag(engine, entries, stateResources) {
|
|
30535
30715
|
const read = /* @__PURE__ */ new Map();
|
|
30536
|
-
for (const
|
|
30537
|
-
const names = secretNamesReadBy(
|
|
30716
|
+
for (const entry of entries) {
|
|
30717
|
+
const names = secretNamesReadBy(entry.logicalId, { properties: entry.properties }, stateResources, (otherId) => ({
|
|
30538
30718
|
secrets: engine.namingSecretsFor(otherId),
|
|
30539
30719
|
embedded: engine.perResourceSecrets.get(otherId)
|
|
30540
30720
|
}));
|
|
30541
30721
|
for (const needle of names) recordLogOnlyValue(read, needle);
|
|
30542
30722
|
}
|
|
30543
30723
|
const own = /* @__PURE__ */ new Map();
|
|
30544
|
-
for (const
|
|
30545
|
-
const needles = secretNameNeedlesOf(
|
|
30546
|
-
resourceType:
|
|
30547
|
-
physicalId:
|
|
30548
|
-
properties:
|
|
30549
|
-
}, engine.namingSecretsFor(
|
|
30724
|
+
for (const entry of entries) {
|
|
30725
|
+
const needles = secretNameNeedlesOf(entry.logicalId, {
|
|
30726
|
+
resourceType: entry.resourceType,
|
|
30727
|
+
physicalId: entry.physicalId,
|
|
30728
|
+
properties: entry.properties
|
|
30729
|
+
}, engine.namingSecretsFor(entry.logicalId), { embedded: engine.perResourceSecrets.get(entry.logicalId) });
|
|
30550
30730
|
for (const needle of needles ?? []) recordLogOnlyValue(own, needle);
|
|
30551
30731
|
}
|
|
30552
30732
|
return unionOfSecretBags([
|
|
30553
|
-
...
|
|
30733
|
+
...entries.map((entry) => engine.printingSecretsFor(entry.logicalId)),
|
|
30554
30734
|
own,
|
|
30555
30735
|
read
|
|
30556
30736
|
]);
|
|
@@ -30572,11 +30752,14 @@ async function performRollback(completedOperations, stateResources, stackName, p
|
|
|
30572
30752
|
const runId = this.options.eventRecorder?.runId;
|
|
30573
30753
|
const { result, failed, run } = await withNestedRevertRun(runId, async (scope) => {
|
|
30574
30754
|
return {
|
|
30575
|
-
failed: orphanOps.length > 0 ? await withPrintingSecrets(
|
|
30755
|
+
failed: orphanOps.length > 0 ? await withPrintingSecrets(replayPrintingBag(this, orphanOps.map((op) => ({
|
|
30756
|
+
...op,
|
|
30757
|
+
properties: op.attemptedProperties
|
|
30758
|
+
})), stateResources), () => replayFailedOperations(orphanOps, stateResources, stackName, ctx, {
|
|
30576
30759
|
emitEnvelope: completedOperations.length === 0,
|
|
30577
30760
|
inlinePolicyWriters
|
|
30578
30761
|
})) : void 0,
|
|
30579
|
-
result: await replayRollback(completedOperations, stateResources, stackName, ctx, { inlinePolicyWriters }),
|
|
30762
|
+
result: await withPrintingSecrets(replayPrintingBag(this, completedReplayEntries(completedOperations), stateResources), () => replayRollback(completedOperations, stateResources, stackName, ctx, { inlinePolicyWriters })),
|
|
30580
30763
|
run: scope
|
|
30581
30764
|
};
|
|
30582
30765
|
});
|
|
@@ -31281,7 +31464,7 @@ function redactParametersForDiff(parameterValues) {
|
|
|
31281
31464
|
const inherited = this.options.inheritedSecrets;
|
|
31282
31465
|
if (!inherited || inherited.size === 0) return parameterValues;
|
|
31283
31466
|
const out = Object.create(null);
|
|
31284
|
-
for (const [name, value] of Object.entries(parameterValues)) out[name] =
|
|
31467
|
+
for (const [name, value] of Object.entries(parameterValues)) out[name] = redactInheritedParameterValue(inherited, name, value);
|
|
31285
31468
|
return out;
|
|
31286
31469
|
}
|
|
31287
31470
|
function rememberRecoverableMaskedOutputs(stackName, resolved, redacted) {
|
|
@@ -31501,7 +31684,7 @@ async function replaceDeleteFirstAndRecreate(logicalId, resourceType, oldResourc
|
|
|
31501
31684
|
recordedAttributes: currentResource.attributes
|
|
31502
31685
|
});
|
|
31503
31686
|
} catch (deleteError) {
|
|
31504
|
-
throw new Error(maskSecretsInText(`Failed to delete old resource ${logicalId} (${currentResource.physicalId}) during the --replace delete-first fallback: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`, secrets));
|
|
31687
|
+
throw new Error(maskSecretsInText(`Failed to delete old resource ${logicalId} (${currentResource.physicalId}) during the --replace delete-first fallback: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`, secrets), { cause: deleteError instanceof Error ? maskSecretsInError(deleteError, secrets) : void 0 });
|
|
31505
31688
|
}
|
|
31506
31689
|
reportDeleteGuards(deleteResult, {
|
|
31507
31690
|
physicalId: currentResource.physicalId,
|
|
@@ -31524,7 +31707,7 @@ async function replaceDeleteFirstAndRecreate(logicalId, resourceType, oldResourc
|
|
|
31524
31707
|
isRetryable: isRecreateRetryableError
|
|
31525
31708
|
});
|
|
31526
31709
|
} catch (recreateError) {
|
|
31527
|
-
throw new Error(maskSecretsInText(`Failed to re-create ${logicalId} after the --replace delete-first fallback already deleted the old resource (${currentResource.physicalId}): ${recreateError instanceof Error ? recreateError.message : String(recreateError)}. Re-run the deploy to create it fresh.`, secrets), { cause: recreateError instanceof Error ? recreateError : void 0 });
|
|
31710
|
+
throw new Error(maskSecretsInText(`Failed to re-create ${logicalId} after the --replace delete-first fallback already deleted the old resource (${currentResource.physicalId}): ${recreateError instanceof Error ? recreateError.message : String(recreateError)}. Re-run the deploy to create it fresh.`, secrets), { cause: recreateError instanceof Error ? maskSecretsInError(recreateError, secrets) : void 0 });
|
|
31528
31711
|
}
|
|
31529
31712
|
}
|
|
31530
31713
|
function typeChangeNameQuestion(resourceType, input) {
|
|
@@ -35208,7 +35391,7 @@ async function updateByReplacement({ change, counts, currentProps, currentResour
|
|
|
35208
35391
|
recordedAttributes: currentResource.attributes
|
|
35209
35392
|
});
|
|
35210
35393
|
} catch (deleteError) {
|
|
35211
|
-
throw new Error(`Failed to destroy old resource ${logicalId} (${currentResource.physicalId}) during ${recreateFlagName}: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}
|
|
35394
|
+
throw new Error(maskSecretsInText(`Failed to destroy old resource ${logicalId} (${currentResource.physicalId}) during ${recreateFlagName}: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`, updateSecrets), { cause: deleteError instanceof Error ? maskSecretsInError(deleteError, updateSecrets) : void 0 });
|
|
35212
35395
|
}
|
|
35213
35396
|
reportDeleteGuards(recreateDeleteResult, {
|
|
35214
35397
|
physicalId: currentResource.physicalId,
|
|
@@ -37921,5 +38104,5 @@ DeployEngine.prototype.replacementNameOrigin = replacementNameOrigin;
|
|
|
37921
38104
|
DeployEngine.prototype.orphanedNameCollisionAdvice = orphanedNameCollisionAdvice;
|
|
37922
38105
|
|
|
37923
38106
|
//#endregion
|
|
37924
|
-
export { resourcesNamingDeclaredParameter as $, maskSecretsInError as $a, repairMalformedResourcesForReadOnly as $i, isWaitAbandonedError as $n, isCrossRegionRedirect as $o, hasReadableOrphans as $r, StageLoadError as $s, updatePartialMessage as $t, resolveDynamoDbDeleteBudgetClock as A, prefetchCreateOnlyPropertyPaths as Aa, refuseMalformedOrphansForOrphan as Ai, DBPROXY_TAG_OPTIONS as An, exportNamesCarriedFrom as Ao, isUnboundTemplateParameter as Ar, loadCdkJson as As, demoteSupersededOrphans as At, getPriorAttempts as B, inheritNestedStackParameterAssociations as Ba, refuseMalformedResourcePropertiesForDestroy as Bi, ccBrokenReason as Bn, AssetPublisher as Bo, isStalePlaceholderArnAttribute as Br, ssmResolvedValueType as Bs, ATOMIC_FINAL_SNAPSHOT_TYPES as Bt, perType as C, configIntegerRefusal as Ca, previewableOrphanRecords as Ci, RollbackInlinePolicyWriters as Cn, LockManager as Co, isSettledInstanceState as Cr, stripControlChars as Cs, replayFailedOperations as Ct, beginDeleteWait as D, requireConfigArray as Da, refuseMalformedOrphanRecordsForDestroy as Di, withCreateTokenLedger as Dn, splitImportedOps as Do, s3BucketRegionalDomainName as Dr, synthesisStatusMessage as Ds, getStackRecords as Dt, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as E, replayWarn as Ea, refuseMalformedOrphanRecords as Ei, reserveStackCreateToken as En, rebuildClientForBucketRegion as Eo, s3BucketDualStackDomainName as Er, Synthesizer as Es, destroyStackRecordsView as Et, waitForIndexesSettled as F, lambdaFunctionNameForMask as Fa, refuseMalformedResourceEntriesForDeploy as Fi, tagPlanWarning as Fn, importableOutputs as Fo, carriesFetchableDynamicReference as Fr, resolveStateBucketWithDefault as Fs, replacementNeverSwapped as Ft, cyan as G, literalSplitDelimitersOf as Ga, refuseMalformedResourcesForDestroy as Gi, CloudControlProvider as Gn, createAssetRedirectResolver as Go, passedParameterClassesOf as Gr, uploadCfnTemplate as Gs, effectiveDeletionPolicy as Gt, formatResourceLine as H, carryLogOnlyValues as Ha, refuseMalformedResourcePropertiesForExport as Hi, isCustomResourceType as Hn, stringifyValue as Ho, parseWebACLArn as Hr, CFN_TEMPLATE_URL_LIMIT as Hs, buildFinalSnapshotIdentifier as Ht, ECR_AUTO_DELETE_IMAGES_TAG as I, sameLambdaFunctionAddress as Ia, refuseMalformedResourceEntriesForDestroy as Ii, definedAttributes as In, isReadableBag as Io, isNamelessDynamicReferenceError as Ir, resolveStateBucketWithDefaultAndSource as Is, resolveReplacementOldType as It, red as J, recordLogOnlyParameterValue as Ja, repairMalformedOrphanRecordsForReadOnly as Ji, unchangedBehindSecretReference as Jn, AssetModeResolver as Jo, STATE_RESOURCES_MALFORMED as Jr, expectedOwnerParam as Js, unsupportedFinalSnapshotError as Jt, gray as K, logOnlyValueCount as Ka, refuseMalformedResourcesForExport as Ki, slowCcOperationTimeoutMs as Kn, loadPublishableAssetManifest as Ko, JSON_LISTING_HOLE_VALUE as Kr, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Ks, isFinalSnapshotError as Kt, S3_AUTO_DELETE_OBJECTS_TAG as L, DagBuilder as La, refuseMalformedResourceEntriesForImport as Li, stringifyIfAssigned as Ln, orphansAfterRollback as Lo, keepsSecretReferenceToken as Lr, resolveUseCdkBootstrapAssets as Ls, findNestedStackTypeChanges as Lt, DELETE_INDEX_WAIT_PROCEED_NOTE as M, describeTypeWithThrottleRetry as Ma, refuseMalformedOutputsForDestroy as Mi, readTagList as Mn, hasReasonlessBaselineRefusal as Mo, getAccountInfo as Mr, resolveAutoAssetStorage as Ms, isReplacementOrphan as Mt, INDEX_SETTLE_POLL_INTERVAL_MS as N, withRetry as Na, refuseMalformedResourceAttributesForOrphan as Ni, refuseMalformedDesiredTags as Nn, hasUnverifiableParameterRefusal as No, isImpossibleEmptyStoredAttribute as Nr, resolveCaptureObservedState as Ns, planFailedOps as Nt, compensateRemovedDeletionProtection as O, requireConfigObject as Oa, refuseMalformedOrphans as Oi, acquireIdempotencyToken as On, acceptedCreateOnlyDropsOf as Oo, s3BucketWebsiteUrl as Or, getDefaultStateBucketName as Os, withStackRecords as Ot, deleteTableWithIndexBusyRetry as P, canonicalLambdaFunctionName as Pa, refuseMalformedResourceEntries as Pi, tagMapAsList as Pn, importableOutputKeys as Po, carriesDynamicReference as Pr, resolveSkipPrefix as Ps, planRollback as Pt, reachableDivergentParameters as Q, errorCauseChain as Qa, repairMalformedResourcePropertiesForReadOnly as Qi, withIndeterminateGuard as Qn, getBootstrapMarkerKey as Qo, displayLogicalId as Qr, AssemblyReader as Qs, redactedDeleteAddressSkip as Qt, hasCdkAutoDeleteTag as R, TemplateParser as Ra, refuseMalformedResourceEntriesForImportSave as Ri, CC_BROKEN_REASON as Rn, orphansCarriedFrom as Ro, AWS_NO_VALUE as Rr, stateBucketExistenceConfirmed as Rs, getCurrentProducerRegions as Rt, isProtectionValueActive as S, configBooleanRefusal as Sa, malformedStateRefusalMessage as Si, formatDestructiveChange as Sn, isSingleDynamicReferenceToken as So, envCredentialsAreAssumedRole as Sr, escapeRegExp$3 as Ss, withNestedStackContext as St, DynamoDBGlobalTableProvider as T, readConfigString as Ta, refuseMalformedNestedChildOutputs as Ti, ledgerForStack as Tn, S3StateBackend as To, s3BucketDomainName as Tr, getDockerImageBySourceHash as Ts, awaitInFlightSibling as Tt, createReadOnlyAttributeHealerFactory as U, createUnionSecretMasker as Ua, refuseMalformedResourcePropertiesForOrphan as Ui, getCurrentResourceSecrets as Un, WorkGraph as Uo, withSharedDrainBudget as Ur, MIGRATE_TMP_PREFIX as Us, ccRoutedFinalSnapshotError as Ut, markRefusedBeforeApplying as V, recordNestedStackParameterExpressions as Va, refuseMalformedResourcePropertiesForDrift as Vi, wouldReturnToSdkProvider as Vn, isSensitiveAttributeName as Vo, refStateLookupFromResource as Vr, CFN_TEMPLATE_BODY_LIMIT as Vs, PRE_DELETE_SNAPSHOT_TYPES as Vt, bold as W, hasMaskableValues as Wa, refuseMalformedResourcesForDeploy as Wi, withPrintingSecrets as Wn, buildAssetRedirectMap as Wo, parameterInputsFor as Wr, findLargeInlineResources as Ws, createPreDeleteFinalSnapshot as Wt, computeParameterTaint as X, shareLogOnlyValues as Xa, repairMalformedOutputsForReadOnly as Xi, deleteIndeterminateGuards as Xn, assertAssetBucketRegion as Xo, UNREADABLE_RESOURCES_MAP_ROW as Xr, canonicalizeRegion as Xs, isRedactedRecordedValue as Xt, yellow as Y, recordLogOnlyValue as Ya, repairMalformedOrphansForReadOnly as Yi, UNSPECIFIED_SKIP_REASON as Yn, BOOTSTRAP_MARKER_PREFIX as Yo, UNREADABLE_ORPHANS_CONTAINER_ROW as Yr, PARTITION_TABLE as Ys, REDACTED_DELETE_ADDRESS_SKIP_REASON as Yt, namesAnyDeclaredParameter as Z, createSecretMasker as Za, repairMalformedResourceEntriesForReadOnly as Zi, deleteSkipReason as Zn, ensureAssetStorage as Zo, deployRefusesOrphanRowsReason as Zr, derivePartitionAndUrlSuffix as Zs, redactedDeleteAddressFields as Zt, makeCanonicalizePropertiesFn as _, isWarmThroughputDecrease as _a, malformedRenderedContainersWarning as _i, DEFAULT_RESOURCE_TIMEOUT_MS as _n, STATE_SOURCED_BASELINE_RULES as _o, isIamRoleArn as _r, redactDockerArgvValues as _s, recordDisplacedSkips as _t, findNestedTemplateTreeDefect as a, unwrittenCreateOnlyReplacement as aa, ownValue as ac, malformedExportNamesWarning as ai, displayTextOrWithheld as an, DYNAMIC_REFERENCE_TOKEN_SCAN as ao, reDisableInstanceApiTermination as ar, buildDockerImage as as, journaledOrphanPrintingBag as at, recordedProtectionNote as b, coerceCfnBoolean as ba, malformedResourcesWarning as bi, constructPathOf as bn, TEMPLATE_SOURCED_RULES as bo, applyCallerIdentityCredentials as br, runDockerStreaming as bs, withNestedRevertRun as bt, renderNestedTemplateTreeDefect as c, hasNoCloudControlHandlers as ca, displayAssemblyPath as cc, malformedLocalResourceEntriesWarning as ci, secretBearingStateKeyWarning as cn, pathCrossesDottedKey as co, INTRINSIC_KEYS as cr, describeDockerExecFailure as cs, stateSecretNameNeedles as ct, conditionInputsFrom as d, MULTI_REGION_RECREATE_BLOCKED_TYPES as da, clearBucketRegionCache as dc, malformedOrphanRecordsWarning as di, isWholeDynamicReferenceValue as dn, provenPublicValue as do, producerRegionsFromState as dr, finchSecretArgvRefusal as ds, NESTED_PENDING_PARENT_REASON as dt, unpreviewableOrphanRecords as ea, processStackMessages as ec, hasReadableOutputs as ei, updatePartialReason as en, maskSecretsInText as eo, markWaitAbandoned as er, parseBootstrapMarker as es, deleteJournaledOrphans as et, parentSuppliedValues as f, isStatefulRecreateTargetForReplace as fa, resolveBucketRegion as fc, malformedOrphanRowsKeptWarning as fi, noEchoParameterValueSeed as fn, recordMaskOnlyValue as fo, regionLessSecretName as fr, formatDockerLoginError as fs, displacedOpClause as ft, mergeNoChangeOutputs as g, coerceWarmThroughput as ga, malformedOutputsWarning as gi, bindingSkippedOutputs as gn, wholeStringLeavesOf as go, explicitRoleArnOrThrow as gr, partitionSensitiveEnv as gs, nestedChildStackName as gt, keptWholeReasonText as h, WARM_THROUGHPUT_MEMBERS as ha, malformedOutputsRefusalMessage as hi, isExportAliasCollision as hn, recordProvenPublicExpression as ho, assertSendableRoleArn as hr, isMalformedEnvKey as hs, getNestedRevertRun as ht, childTemplateLoader as i, findSilentDropProperties as ia, nullPrototypeRecord as ic, malformedDriftResourcePropertiesWarning as ii, WITHHELD_NAME_DISPLAY as in, recoverMaskedOutput as io, observeThenDisableInstanceApiTermination as ir, buildDenyExternalAccessPolicy as is, sameJournaledOrphans as it, resolveDynamoDbDeleteBudgetMs as j, templateResourceTypes as ja, refuseMalformedOutputs as ji, planTagDiff as jn, hasReadableExportSet as jo, parameterTypeMayLoseSecretIdentity as jr, resolveApp as js, isJournaledOrphan as jt, deleteBudgetKey as k, requireConfigString as ka, refuseMalformedOrphansForDestroy as ki, DBPROXY_TAGS_WHAT as kn, describeRegionValueKind as ko, coerceParameterTypedValue as kr, getLegacyStateBucketName as ks, recordAfterRollbackUpdate as kt, templateIdentity as l, findReplacedReadersOfRecreateTargets as la, renderAssemblyPathEscape as lc, malformedLocalResourcesWarning as li, secretSafeKeyDisplay as ln, identityKeyFor as lo, IntrinsicFunctionResolver as lr, describeDockerFailure as ls, makeSiblingClaimReader as lt, isSecretBearingReferenceString as m, renderStatefulReason as ma, malformedOrphansWarning as mi, collectPublishedOutputNames as mn, recordNoEchoAttributeValues as mo, assertFlagRoleArn as mr, isDockerClientEnvKey as ms, dropSettledNestedJournals as mt, IMPLICIT_DELETE_DEPENDENCIES as n, unreadableResourceEntries as na, hasOwnKey as nc, isReadableOrphanRecord as ni, DeploymentEventsStore as nn, redactSecretsForState as no, ec2InstanceProtectionSite as nr, validateAssetBucketName as ns, journaledOrphanLines as nt, isAbsoluteAssetPath as o, withoutSilentDropProperties as oa, absoluteAssemblyPathEscape as oc, malformedExportSourceWarning as oi, exportAliasCollisionScrubWarning as on, dynamicReferenceTokens as oo, reEnableInstanceApiTermination as or, resolveDockerContextDirectory as os, maskEventTextWithBoundBags as ot, readRecordedConditionVerdicts as p, isStatefulRecreateTargetSync as pa, malformedOrphansRefusalMessage as pi, collectDeclaredOutputNames as pn, recordMaskOnlyValuesIn as po, applyRoleArnIfSet as pr, getDockerCmd as ps, displacedPhysicalIdShown as pt, green as q, printingCorpusOf as qa, refuseMalformedState as qi, ccProtectionRegistryTypes as qn, rewriteTemplateAssetReferences as qo, STATE_REGION_DIVERGED as qr, decodeListingKey as qs, refusesFinalSnapshot as qt, computeImplicitDeleteEdges as r, findActionableSilentDrops as ra, hasPlainPrototype$1 as rc, isReadableResourceEntry as ri, extractDeploymentEventError as rn, scrubResourceRecord as ro, isTerminationProtectionPropagationError as rr, validateContainerRepoName as rs, loadJournaledOrphans as rt, listNestedTemplateRows as s, NO_CC_HANDLERS_REASON as sa, describeFileReadFailure as sc, malformedLocalOutputsWarning as si, secretBearing as sn, isUncertifiedBaselineMaskPosition as so, DiffCalculator as sr, describeDockerCapturedOutput as ss, secretNamePrintingBag as st, DeployEngine as t, unreadableOrphanRecords as ta, defineOwnKey as tc, hasReadableResources as ti, DeploymentEventsReader as tn, markSameGenerationBag as to, disableInstanceApiTermination as tr, readBootstrapMarkerBody as ts, isHandledOrphan as tt, conditionFingerprint as u, shownType as ua, resolveAssemblyPath as uc, malformedOrphanRecordsRefusalMessage as ui, exportNameSecretExposure as un, carriesSecretMask as uo, classifyReplaySecretRegion as ur, dockerSpawnEnvWithSensitive as us, planOrphanAdoption as ut, withResourceDeadline as v, toCfnInteger as va, malformedResourceEntriesWarning as vi, DEFAULT_RESOURCE_WARN_AFTER_MS as vn, STATE_SOURCED_CROSS_GENERATION_RULES as vo, sendableAssumeRoleCommand as vr, redactedDockerCause as vs, revertNestedChildFromJournal as vt, readProtection as w, configStringRefusal as wa, refuseDivergentRecordRegionForDestroy as wi, earliestDefined as wn, isLockInfoExpired as wo, s3BucketArn as wr, AssetManifestLoader as ws, replayRollback as wt, PROTECTION_PROPERTY_BY_TYPE as x, coerceCfnInteger as xa, malformedScrubResourceEntriesRefusalMessage as xi, findDestructiveChanges as xn, WHOLE_DYNAMIC_REFERENCE_PATTERN as xo, callerEnvCredentials as xr, warnFinchArgvExposure as xs, getCurrentNestedStackContext as xt, recordedProtectionEvidence as y, toFiniteNumber as ya, malformedResourcePropertiesWarning as yi, maskingRetryLogger as yn, STATE_SOURCED_READBACK_RULES as yo, AWS_CREDENTIAL_ENV_KEYS as yr, runDockerForeground as ys, revertedNestedRowIds as yt, isTruthyCfnBoolean as z, liveMatchesUnresolvedTokenFrame as za, refuseMalformedResourceEntriesForOrphan as zi, ProviderRegistry as zn, shouldRetainResource as zo, cfnRefValueFromPhysicalId as zr, warnDeprecatedNoPrefixCliFlag as zs, inheritProducerRegions as zt };
|
|
37925
|
-
//# sourceMappingURL=deploy-engine-
|
|
38107
|
+
export { resourcesNamingDeclaredParameter as $, maskSecretsInError as $a, repairMalformedResourceEntriesForReadOnly as $i, deleteSkipReason as $n, ensureAssetStorage as $o, deployRefusesOrphanRowsReason as $r, derivePartitionAndUrlSuffix as $s, effectiveDeletionPolicy as $t, resolveDynamoDbDeleteBudgetClock as A, requireConfigObject as Aa, refuseMalformedOrphans as Ai, acquireIdempotencyToken as An, acceptedCreateOnlyDropsOf as Ao, s3BucketWebsiteUrl as Ar, getDefaultStateBucketName as As, planRollback as At, getPriorAttempts as B, TemplateParser as Ba, refuseMalformedResourceEntriesForImportSave as Bi, CC_BROKEN_REASON as Bn, orphansCarriedFrom as Bo, AWS_NO_VALUE as Br, stateBucketExistenceConfirmed as Bs, updatePartialMessage as Bt, perType as C, coerceCfnInteger as Ca, malformedScrubResourceEntriesRefusalMessage as Ci, findDestructiveChanges as Cn, WHOLE_DYNAMIC_REFERENCE_PATTERN as Co, callerEnvCredentials as Cr, warnFinchArgvExposure as Cs, getStackRecords as Ct, beginDeleteWait as D, readConfigString as Da, refuseMalformedNestedChildOutputs as Di, ledgerForStack as Dn, S3StateBackend as Do, s3BucketDomainName as Dr, getDockerImageBySourceHash as Ds, isJournaledOrphan as Dt, DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS as E, configStringRefusal as Ea, refuseDivergentRecordRegionForDestroy as Ei, earliestDefined as En, isLockInfoExpired as Eo, s3BucketArn as Er, AssetManifestLoader as Es, demoteSupersededOrphans as Et, waitForIndexesSettled as F, withRetry as Fa, refuseMalformedResourceAttributesForOrphan as Fi, refuseMalformedDesiredTags as Fn, hasUnverifiableParameterRefusal as Fo, isImpossibleEmptyStoredAttribute as Fr, resolveCaptureObservedState as Fs, inheritProducerRegions as Ft, cyan as G, literalSplitDelimitersOf as Ga, refuseMalformedResourcePropertiesForOrphan as Gi, getCurrentResourceSecrets as Gn, WorkGraph as Go, withSharedDrainBudget as Gr, MIGRATE_TMP_PREFIX as Gs, orphanRecordsPrintingBag as Gt, formatResourceLine as H, carryLogOnlyValues as Ha, refuseMalformedResourcePropertiesForDestroy as Hi, ccBrokenReason as Hn, AssetPublisher as Ho, isStalePlaceholderArnAttribute as Hr, ssmResolvedValueType as Hs, completedReplayEntries as Ht, ECR_AUTO_DELETE_IMAGES_TAG as I, canonicalLambdaFunctionName as Ia, refuseMalformedResourceEntries as Ii, tagMapAsList as In, importableOutputKeys as Io, carriesDynamicReference as Ir, resolveSkipPrefix as Is, REDACTED_DELETE_ADDRESS_SKIP_REASON as It, red as J, recordLogOnlyParameterValue as Ja, refuseMalformedResourcesForExport as Ji, slowCcOperationTimeoutMs as Jn, loadPublishableAssetManifest as Jo, JSON_LISTING_HOLE_VALUE as Jr, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as Js, ATOMIC_FINAL_SNAPSHOT_TYPES as Jt, gray as K, logOnlyValueCount as Ka, refuseMalformedResourcesForDeploy as Ki, withPrintingSecrets as Kn, buildAssetRedirectMap as Ko, parameterInputsFor as Kr, findLargeInlineResources as Ks, secretNamePrintingBag as Kt, S3_AUTO_DELETE_OBJECTS_TAG as L, lambdaFunctionNameForMask as La, refuseMalformedResourceEntriesForDeploy as Li, tagPlanWarning as Ln, importableOutputs as Lo, carriesFetchableDynamicReference as Lr, resolveStateBucketWithDefault as Ls, isRedactedRecordedValue as Lt, DELETE_INDEX_WAIT_PROCEED_NOTE as M, prefetchCreateOnlyPropertyPaths as Ma, refuseMalformedOrphansForOrphan as Mi, DBPROXY_TAG_OPTIONS as Mn, exportNamesCarriedFrom as Mo, isUnboundTemplateParameter as Mr, loadCdkJson as Ms, resolveReplacementOldType as Mt, INDEX_SETTLE_POLL_INTERVAL_MS as N, templateResourceTypes as Na, refuseMalformedOutputs as Ni, planTagDiff as Nn, hasReadableExportSet as No, parameterTypeMayLoseSecretIdentity as Nr, resolveApp as Ns, findNestedStackTypeChanges as Nt, compensateRemovedDeletionProtection as O, replayWarn as Oa, refuseMalformedOrphanRecords as Oi, reserveStackCreateToken as On, rebuildClientForBucketRegion as Oo, s3BucketDualStackDomainName as Or, Synthesizer as Os, isReplacementOrphan as Ot, deleteTableWithIndexBusyRetry as P, describeTypeWithThrottleRetry as Pa, refuseMalformedOutputsForDestroy as Pi, readTagList as Pn, hasReasonlessBaselineRefusal as Po, getAccountInfo as Pr, resolveAutoAssetStorage as Ps, getCurrentProducerRegions as Pt, reachableDivergentParameters as Q, errorCauseChain as Qa, repairMalformedOutputsForReadOnly as Qi, deleteIndeterminateGuards as Qn, assertAssetBucketRegion as Qo, UNREADABLE_RESOURCES_MAP_ROW as Qr, canonicalizeRegion as Qs, createPreDeleteFinalSnapshot as Qt, hasCdkAutoDeleteTag as R, sameLambdaFunctionAddress as Ra, refuseMalformedResourceEntriesForDestroy as Ri, definedAttributes as Rn, isReadableBag as Ro, isNamelessDynamicReferenceError as Rr, resolveStateBucketWithDefaultAndSource as Rs, redactedDeleteAddressFields as Rt, isProtectionValueActive as S, coerceCfnBoolean as Sa, malformedResourcesWarning as Si, constructPathOf as Sn, TEMPLATE_SOURCED_RULES as So, applyCallerIdentityCredentials as Sr, runDockerStreaming as Ss, destroyStackRecordsView as St, DynamoDBGlobalTableProvider as T, configIntegerRefusal as Ta, previewableOrphanRecords as Ti, RollbackInlinePolicyWriters as Tn, LockManager as To, isSettledInstanceState as Tr, stripControlChars as Ts, recordAfterRollbackUpdate as Tt, createReadOnlyAttributeHealerFactory as U, createUnionSecretMasker as Ua, refuseMalformedResourcePropertiesForDrift as Ui, wouldReturnToSdkProvider as Un, isSensitiveAttributeName as Uo, refStateLookupFromResource as Ur, CFN_TEMPLATE_BODY_LIMIT as Us, journaledOrphanPrintingBag as Ut, markRefusedBeforeApplying as V, liveMatchesUnresolvedTokenFrame as Va, refuseMalformedResourceEntriesForOrphan as Vi, ProviderRegistry as Vn, shouldRetainResource as Vo, cfnRefValueFromPhysicalId as Vr, warnDeprecatedNoPrefixCliFlag as Vs, updatePartialReason as Vt, bold as W, hasMaskableValues as Wa, refuseMalformedResourcePropertiesForExport as Wi, isCustomResourceType as Wn, stringifyValue as Wo, parseWebACLArn as Wr, CFN_TEMPLATE_URL_LIMIT as Ws, maskEventTextWithBoundBags as Wt, computeParameterTaint as X, shareLogOnlyValues as Xa, repairMalformedOrphanRecordsForReadOnly as Xi, unchangedBehindSecretReference as Xn, AssetModeResolver as Xo, STATE_RESOURCES_MALFORMED as Xr, expectedOwnerParam as Xs, buildFinalSnapshotIdentifier as Xt, yellow as Y, recordLogOnlyValue as Ya, refuseMalformedState as Yi, ccProtectionRegistryTypes as Yn, rewriteTemplateAssetReferences as Yo, STATE_REGION_DIVERGED as Yr, decodeListingKey as Ys, PRE_DELETE_SNAPSHOT_TYPES as Yt, namesAnyDeclaredParameter as Z, createSecretMasker as Za, repairMalformedOrphansForReadOnly as Zi, UNSPECIFIED_SKIP_REASON as Zn, BOOTSTRAP_MARKER_PREFIX as Zo, UNREADABLE_ORPHANS_CONTAINER_ROW as Zr, PARTITION_TABLE as Zs, ccRoutedFinalSnapshotError as Zt, makeCanonicalizePropertiesFn as _, WARM_THROUGHPUT_MEMBERS as _a, malformedOutputsRefusalMessage as _i, isExportAliasCollision as _n, recordProvenPublicExpression as _o, assertSendableRoleArn as _r, isMalformedEnvKey as _s, getCurrentNestedStackContext as _t, findNestedTemplateTreeDefect as a, findActionableSilentDrops as aa, hasPlainPrototype$1 as ac, isReadableResourceEntry as ai, extractDeploymentEventError as an, dynamicReferenceTokens as ao, isTerminationProtectionPropagationError as ar, validateContainerRepoName as as, makeSiblingClaimReader as at, recordedProtectionNote as b, toCfnInteger as ba, malformedResourceEntriesWarning as bi, DEFAULT_RESOURCE_WARN_AFTER_MS as bn, STATE_SOURCED_CROSS_GENERATION_RULES as bo, sendableAssumeRoleCommand as br, redactedDockerCause as bs, replayRollback as bt, renderNestedTemplateTreeDefect as c, withoutSilentDropProperties as ca, absoluteAssemblyPathEscape as cc, malformedExportSourceWarning as ci, exportAliasCollisionScrubWarning as cn, inheritNestedStackParameterAssociations as co, reEnableInstanceApiTermination as cr, resolveDockerContextDirectory as cs, displacedOpClause as ct, conditionInputsFrom as d, findReplacedReadersOfRecreateTargets as da, renderAssemblyPathEscape as dc, malformedLocalResourcesWarning as di, secretSafeKeyDisplay as dn, identityKeyFor as do, IntrinsicFunctionResolver as dr, describeDockerFailure as ds, getNestedRevertRun as dt, repairMalformedResourcePropertiesForReadOnly as ea, AssemblyReader as ec, displayLogicalId as ei, isFinalSnapshotError as en, maskSecretsInText as eo, withIndeterminateGuard as er, getBootstrapMarkerKey as es, deleteJournaledOrphans as et, parentSuppliedValues as f, shownType as fa, resolveAssemblyPath as fc, malformedOrphanRecordsRefusalMessage as fi, exportNameSecretExposure as fn, carriesSecretMask as fo, classifyReplaySecretRegion as fr, dockerSpawnEnvWithSensitive as fs, nestedChildStackName as ft, mergeNoChangeOutputs as g, renderStatefulReason as ga, malformedOrphansWarning as gi, collectPublishedOutputNames as gn, recordNoEchoAttributeValues as go, assertFlagRoleArn as gr, isDockerClientEnvKey as gs, withNestedRevertRun as gt, keptWholeReasonText as h, isStatefulRecreateTargetSync as ha, malformedOrphansRefusalMessage as hi, collectDeclaredOutputNames as hn, recordMaskOnlyValuesIn as ho, applyRoleArnIfSet as hr, getDockerCmd as hs, revertedNestedRowIds as ht, childTemplateLoader as i, unreadableResourceEntries as ia, hasOwnKey as ic, isReadableOrphanRecord as ii, DeploymentEventsStore as in, DYNAMIC_REFERENCE_TOKEN_SCAN as io, ec2InstanceProtectionSite as ir, validateAssetBucketName as is, sameJournaledOrphans as it, resolveDynamoDbDeleteBudgetMs as j, requireConfigString as ja, refuseMalformedOrphansForDestroy as ji, DBPROXY_TAGS_WHAT as jn, describeRegionValueKind as jo, coerceParameterTypedValue as jr, getLegacyStateBucketName as js, replacementNeverSwapped as jt, deleteBudgetKey as k, requireConfigArray as ka, refuseMalformedOrphanRecordsForDestroy as ki, withCreateTokenLedger as kn, splitImportedOps as ko, s3BucketRegionalDomainName as kr, synthesisStatusMessage as ks, planFailedOps as kt, templateIdentity as l, NO_CC_HANDLERS_REASON as la, describeFileReadFailure as lc, malformedLocalOutputsWarning as li, secretBearing as ln, recordNestedStackParameterExpressions as lo, DiffCalculator as lr, describeDockerCapturedOutput as ls, displacedPhysicalIdShown as lt, isSecretBearingReferenceString as m, isStatefulRecreateTargetForReplace as ma, resolveBucketRegion as mc, malformedOrphanRowsKeptWarning as mi, noEchoParameterValueSeed as mn, recordMaskOnlyValue as mo, regionLessSecretName as mr, formatDockerLoginError as ms, revertNestedChildFromJournal as mt, IMPLICIT_DELETE_DEPENDENCIES as n, unpreviewableOrphanRecords as na, processStackMessages as nc, hasReadableOutputs as ni, unsupportedFinalSnapshotError as nn, redactSecretsForState as no, markWaitAbandoned as nr, parseBootstrapMarker as ns, journaledOrphanLines as nt, isAbsoluteAssetPath as o, findSilentDropProperties as oa, nullPrototypeRecord as oc, malformedDriftResourcePropertiesWarning as oi, WITHHELD_NAME_DISPLAY as on, isUncertifiedBaselineMaskPosition as oo, observeThenDisableInstanceApiTermination as or, buildDenyExternalAccessPolicy as os, planOrphanAdoption as ot, readRecordedConditionVerdicts as p, MULTI_REGION_RECREATE_BLOCKED_TYPES as pa, clearBucketRegionCache as pc, malformedOrphanRecordsWarning as pi, isWholeDynamicReferenceValue as pn, provenPublicValue as po, producerRegionsFromState as pr, finchSecretArgvRefusal as ps, recordDisplacedSkips as pt, green as q, printingCorpusOf as qa, refuseMalformedResourcesForDestroy as qi, CloudControlProvider as qn, createAssetRedirectResolver as qo, passedParameterClassesOf as qr, uploadCfnTemplate as qs, stateSecretNameNeedles as qt, computeImplicitDeleteEdges as r, unreadableOrphanRecords as ra, defineOwnKey as rc, hasReadableResources as ri, DeploymentEventsReader as rn, scrubResourceRecord as ro, disableInstanceApiTermination as rr, readBootstrapMarkerBody as rs, loadJournaledOrphans as rt, listNestedTemplateRows as s, unwrittenCreateOnlyReplacement as sa, ownValue as sc, malformedExportNamesWarning as si, displayTextOrWithheld as sn, pathCrossesDottedKey as so, reDisableInstanceApiTermination as sr, buildDockerImage as ss, NESTED_PENDING_PARENT_REASON as st, DeployEngine as t, repairMalformedResourcesForReadOnly as ta, StageLoadError as tc, hasReadableOrphans as ti, refusesFinalSnapshot as tn, markSameGenerationBag as to, isWaitAbandonedError as tr, isCrossRegionRedirect as ts, isHandledOrphan as tt, conditionFingerprint as u, hasNoCloudControlHandlers as ua, displayAssemblyPath as uc, malformedLocalResourceEntriesWarning as ui, secretBearingStateKeyWarning as un, recoverMaskedOutput as uo, INTRINSIC_KEYS as ur, describeDockerExecFailure as us, dropSettledNestedJournals as ut, withResourceDeadline as v, coerceWarmThroughput as va, malformedOutputsWarning as vi, bindingSkippedOutputs as vn, wholeStringLeavesOf as vo, explicitRoleArnOrThrow as vr, partitionSensitiveEnv as vs, withNestedStackContext as vt, readProtection as w, configBooleanRefusal as wa, malformedStateRefusalMessage as wi, formatDestructiveChange as wn, isSingleDynamicReferenceToken as wo, envCredentialsAreAssumedRole as wr, escapeRegExp$3 as ws, withStackRecords as wt, PROTECTION_PROPERTY_BY_TYPE as x, toFiniteNumber as xa, malformedResourcePropertiesWarning as xi, maskingRetryLogger as xn, STATE_SOURCED_READBACK_RULES as xo, AWS_CREDENTIAL_ENV_KEYS as xr, runDockerForeground as xs, awaitInFlightSibling as xt, recordedProtectionEvidence as y, isWarmThroughputDecrease as ya, malformedRenderedContainersWarning as yi, DEFAULT_RESOURCE_TIMEOUT_MS as yn, STATE_SOURCED_BASELINE_RULES as yo, isIamRoleArn as yr, redactDockerArgvValues as ys, replayFailedOperations as yt, isTruthyCfnBoolean as z, DagBuilder as za, refuseMalformedResourceEntriesForImport as zi, stringifyIfAssigned as zn, orphansAfterRollback as zo, keepsSecretReferenceToken as zr, resolveUseCdkBootstrapAssets as zs, redactedDeleteAddressSkip as zt };
|
|
38108
|
+
//# sourceMappingURL=deploy-engine-wyaJUA8V.js.map
|