@cdkd/cli 0.370.7 → 0.371.1
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/{ambient-client-defaults-DqS6NWx5.js → ambient-client-defaults-Cq58skpK.js} +3 -3
- package/dist/{ambient-client-defaults-DqS6NWx5.js.map → ambient-client-defaults-Cq58skpK.js.map} +1 -1
- package/dist/{asg-provider-BMQeGpmF.js → asg-provider-B3ngG-X4.js} +8 -8
- package/dist/{asg-provider-BMQeGpmF.js.map → asg-provider-B3ngG-X4.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{created-resource-sink-DGvRiBLW.js → created-resource-sink-Bzk9hJNq.js} +4 -4
- package/dist/{created-resource-sink-DGvRiBLW.js.map → created-resource-sink-Bzk9hJNq.js.map} +1 -1
- package/dist/{custom-resource-runtime-BJFVnN9S.js → custom-resource-runtime-CLHhYoEe.js} +6 -6
- package/dist/{custom-resource-runtime-BJFVnN9S.js.map → custom-resource-runtime-CLHhYoEe.js.map} +1 -1
- package/dist/{db-associated-roles-ConAeY8g.js → db-associated-roles-CYA2C3yZ.js} +2 -2
- package/dist/{db-associated-roles-ConAeY8g.js.map → db-associated-roles-CYA2C3yZ.js.map} +1 -1
- package/dist/{delete-started-Dya9H_gI.js → delete-started-D9FEXTba.js} +4 -4
- package/dist/{delete-started-Dya9H_gI.js.map → delete-started-D9FEXTba.js.map} +1 -1
- package/dist/{deploy-engine-CpeBWcxG.js → deploy-engine-DvPDae31.js} +892 -147
- package/dist/deploy-engine-DvPDae31.js.map +1 -0
- package/dist/{ec2-termination-protection-CVTp4mlC.js → ec2-termination-protection-C19A5IH9.js} +3 -3
- package/dist/{ec2-termination-protection-CVTp4mlC.js.map → ec2-termination-protection-C19A5IH9.js.map} +1 -1
- package/dist/{ecr-uri-DwYinaAB.js → ecr-uri-BW6V_9R5.js} +2 -2
- package/dist/{ecr-uri-DwYinaAB.js.map → ecr-uri-BW6V_9R5.js.map} +1 -1
- package/dist/{emr-cluster-provider-CR_OFsGZ.js → emr-cluster-provider-DVljF3YH.js} +10 -10
- package/dist/{emr-cluster-provider-CR_OFsGZ.js.map → emr-cluster-provider-DVljF3YH.js.map} +1 -1
- package/dist/{expected-bucket-owner-BhnjZsLt.js → expected-bucket-owner-DMq5H0Zm.js} +2 -2
- package/dist/{expected-bucket-owner-BhnjZsLt.js.map → expected-bucket-owner-DMq5H0Zm.js.map} +1 -1
- package/dist/{iam-role-provider-CKIdrdu5.js → iam-role-provider-B8c2g5fS.js} +12 -12
- package/dist/{iam-role-provider-CKIdrdu5.js.map → iam-role-provider-B8c2g5fS.js.map} +1 -1
- package/dist/{identity-read-denied-V23l4pKK.js → identity-read-denied-Cl8km1o3.js} +5 -5
- package/dist/{identity-read-denied-V23l4pKK.js.map → identity-read-denied-Cl8km1o3.js.map} +1 -1
- package/dist/{image-plan-D62M_M30.js → image-plan-Cg5bLNvP.js} +9 -9
- package/dist/{image-plan-D62M_M30.js.map → image-plan-Cg5bLNvP.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-CSLdt93b.js → logger-BUi1Imxa.js} +2 -2
- package/dist/{logger-CSLdt93b.js.map → logger-BUi1Imxa.js.map} +1 -1
- package/dist/{neptune-provider-BCXKNNXR.js → neptune-provider-Ddse7yYJ.js} +9 -9
- package/dist/{neptune-provider-BCXKNNXR.js.map → neptune-provider-Ddse7yYJ.js.map} +1 -1
- package/dist/{program-Lw5gWY1A.js → program-bUaiwzJ2.js} +195 -49
- package/dist/program-bUaiwzJ2.js.map +1 -0
- package/dist/{provider-classes-DOrSeS2t.js → provider-classes-AI1PLFRf.js} +165 -40
- package/dist/provider-classes-AI1PLFRf.js.map +1 -0
- package/dist/{rds-provider-CCpEJkcN.js → rds-provider-6Cj8pik8.js} +103 -24
- package/dist/rds-provider-6Cj8pik8.js.map +1 -0
- package/dist/{read-replica-Dkepeh8a.js → read-replica-DWbYq3Fh.js} +3 -3
- package/dist/{read-replica-Dkepeh8a.js.map → read-replica-DWbYq3Fh.js.map} +1 -1
- package/dist/{redacted-delete-address-BPwMWIOq.js → redacted-delete-address-C1M-bYXm.js} +4 -4
- package/dist/{redacted-delete-address-BPwMWIOq.js.map → redacted-delete-address-C1M-bYXm.js.map} +1 -1
- package/dist/{replacement-rules-aKrUHcS2.js → replacement-rules-BimJi0H1.js} +516 -31
- package/dist/replacement-rules-BimJi0H1.js.map +1 -0
- package/dist/{resource-deadline-DjIkTygT.js → resource-deadline-Cj-4PzvY.js} +2 -2
- package/dist/{resource-deadline-DjIkTygT.js.map → resource-deadline-Cj-4PzvY.js.map} +1 -1
- package/dist/{restore-source-guard-Bprs9w8d.js → restore-source-guard-CP2cxnnh.js} +4 -4
- package/dist/{restore-source-guard-Bprs9w8d.js.map → restore-source-guard-CP2cxnnh.js.map} +1 -1
- package/dist/{run-cli-BfDyKYOs.js → run-cli-C0ZXPvze.js} +2 -2
- package/dist/{run-cli-BfDyKYOs.js.map → run-cli-C0ZXPvze.js.map} +1 -1
- package/dist/{secret-reference-immutable-DK77ST9u.js → secret-reference-immutable-BLsAuIkM.js} +6 -6
- package/dist/{secret-reference-immutable-DK77ST9u.js.map → secret-reference-immutable-BLsAuIkM.js.map} +1 -1
- package/dist/{settle-own-write-members-DgrfaXCf.js → settle-own-write-members-BJ1rf1Yt.js} +13 -13
- package/dist/{settle-own-write-members-DgrfaXCf.js.map → settle-own-write-members-BJ1rf1Yt.js.map} +1 -1
- package/dist/{tag-list-B4_wJ9vt.js → tag-list-CSQWFQbX.js} +4 -4
- package/dist/{tag-list-B4_wJ9vt.js.map → tag-list-CSQWFQbX.js.map} +1 -1
- package/dist/{version-3YWtwAiy.js → version-CQenoJzP.js} +2 -2
- package/dist/{version-3YWtwAiy.js.map → version-CQenoJzP.js.map} +1 -1
- package/package.json +2 -2
- package/dist/deploy-engine-CpeBWcxG.js.map +0 -1
- package/dist/program-Lw5gWY1A.js.map +0 -1
- package/dist/provider-classes-DOrSeS2t.js.map +0 -1
- package/dist/rds-provider-CCpEJkcN.js.map +0 -1
- package/dist/replacement-rules-aKrUHcS2.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as safeMsg, x as SAFE_MSG_ALTERED_CHAR } from "./version-
|
|
2
|
-
import { n as getLogger } from "./logger-
|
|
1
|
+
import { P as safeMsg, x as SAFE_MSG_ALTERED_CHAR } from "./version-CQenoJzP.js";
|
|
2
|
+
import { n as getLogger } from "./logger-BUi1Imxa.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
|
|
5
5
|
// src/deployment/secret-redaction/rules.ts
|
|
@@ -518,7 +518,7 @@ function recordNestedStackParameterExpressions(secrets, resourceType, resolvedPr
|
|
|
518
518
|
const resolvedParameters = resolvedProperties["Parameters"];
|
|
519
519
|
const sourceParameters = sourceProperties["Parameters"];
|
|
520
520
|
if (!isPlainObject(resolvedParameters) || !isPlainObject(sourceParameters)) return;
|
|
521
|
-
const positioned = redactAtProvenance({ ...resolvedParameters }, secrets, sourceParameters, provenance, true);
|
|
521
|
+
const positioned = withoutLiteralRendering(() => redactAtProvenance({ ...resolvedParameters }, secrets, sourceParameters, provenance, true));
|
|
522
522
|
let table = nestedStackParameterExpressions.get(secrets);
|
|
523
523
|
for (const [name, resolvedValue] of Object.entries(resolvedParameters)) {
|
|
524
524
|
const sourceLeaf = sourceParameters[name];
|
|
@@ -1895,8 +1895,8 @@ function replaceAtPath(root, path, leaf) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
|
|
1897
1897
|
// src/deployment/secret-redaction/redact-path/template-literal.ts
|
|
1898
|
-
function isSourcePlainLiteral(bag, source,
|
|
1899
|
-
return rules.sourceIsTemplate === true && typeof bag === "string" && bag === source && !isDynamicReferenceString(source)
|
|
1898
|
+
function isSourcePlainLiteral(bag, source, rules) {
|
|
1899
|
+
return rules.sourceIsTemplate === true && typeof bag === "string" && bag === source && !isDynamicReferenceString(source);
|
|
1900
1900
|
}
|
|
1901
1901
|
function secretRerenderPairs(secrets) {
|
|
1902
1902
|
const pairs = [];
|
|
@@ -1907,16 +1907,20 @@ function secretRerenderPairs(secrets) {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
return pairs;
|
|
1909
1909
|
}
|
|
1910
|
-
function rerenderedSourceLiteral(bag, source, secrets) {
|
|
1910
|
+
function rerenderedSourceLiteral(bag, source, secrets, rules) {
|
|
1911
1911
|
if (typeof bag !== "string" || typeof source !== "string") return void 0;
|
|
1912
1912
|
if (!isDynamicReferenceString(bag) || isDynamicReferenceString(source)) return void 0;
|
|
1913
|
-
if (secrets.has(source)) return void 0;
|
|
1913
|
+
if (rules.sourceIsTemplate !== true && secrets.has(source)) return void 0;
|
|
1914
1914
|
let rendered = bag;
|
|
1915
1915
|
for (const [expression, plaintext] of secretRerenderPairs(secrets)) rendered = rendered.split(expression).join(plaintext);
|
|
1916
1916
|
return rendered === source ? source : void 0;
|
|
1917
1917
|
}
|
|
1918
1918
|
function keepTemplateLiteralLeaves(redacted, raw, template, secrets) {
|
|
1919
|
-
if (typeof raw === "string")
|
|
1919
|
+
if (typeof raw === "string") {
|
|
1920
|
+
if (redacted === "***") return redacted;
|
|
1921
|
+
if (raw === template && !isDynamicReferenceString(raw)) return raw;
|
|
1922
|
+
return rerenderedSourceLiteral(raw, template, secrets, TEMPLATE_SOURCE) ?? redacted;
|
|
1923
|
+
}
|
|
1920
1924
|
if (Array.isArray(raw)) {
|
|
1921
1925
|
if (!Array.isArray(template) || !Array.isArray(redacted)) return redacted;
|
|
1922
1926
|
if (redacted.length !== raw.length || template.length !== raw.length) return redacted;
|
|
@@ -1938,25 +1942,16 @@ function keepTemplateLiteralLeaves(redacted, raw, template, secrets) {
|
|
|
1938
1942
|
}
|
|
1939
1943
|
return out ?? redacted;
|
|
1940
1944
|
}
|
|
1945
|
+
const TEMPLATE_SOURCE = {
|
|
1946
|
+
descendArrays: false,
|
|
1947
|
+
trustAnyExpression: false,
|
|
1948
|
+
sourceIsSameGeneration: false,
|
|
1949
|
+
sourceIsTemplate: true
|
|
1950
|
+
};
|
|
1941
1951
|
function isPlainRecord(value) {
|
|
1942
1952
|
return isPlainObject(value) && hasPlainPrototype(value);
|
|
1943
1953
|
}
|
|
1944
1954
|
|
|
1945
|
-
// src/deployment/secret-redaction/redact-path/baseline-mask.ts
|
|
1946
|
-
function isUncertifiedBaselineMaskPosition(properties, path) {
|
|
1947
|
-
if (pathCrossesDottedKey(properties, path)) return false;
|
|
1948
|
-
const [head] = path.split(".");
|
|
1949
|
-
if (head !== void 0 && RENDERED_DEFINITION_KEYS.has(head)) return definitionSourceCarriesSecret(properties);
|
|
1950
|
-
let cursor = properties;
|
|
1951
|
-
for (const segment of path.split(".")) {
|
|
1952
|
-
if (typeof cursor === "string") break;
|
|
1953
|
-
if (cursor === null || typeof cursor !== "object" || Array.isArray(cursor) || !Object.hasOwn(cursor, segment)) return false;
|
|
1954
|
-
cursor = cursor[segment];
|
|
1955
|
-
}
|
|
1956
|
-
if (typeof cursor === "string") return isDynamicReferenceString(cursor) && cursor !== "***";
|
|
1957
|
-
return subtreeHasDynamicReference(cursor) && !carriesSecretMask(cursor);
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
1955
|
// src/deployment/secret-redaction/redact-path/reference-tokens.ts
|
|
1961
1956
|
const DYNAMIC_REFERENCE_TOKEN_SCAN = new RegExp(`\\{\\{resolve:${DYNAMIC_REFERENCE_INNER}\\}\\}`, "g");
|
|
1962
1957
|
function dynamicReferenceTokens(value) {
|
|
@@ -1989,6 +1984,322 @@ function mixedLeafProvenPublic(source, secrets, readback) {
|
|
|
1989
1984
|
return source.replace(DYNAMIC_REFERENCE_TOKEN_SCAN, (token) => values.get(token)) === readback;
|
|
1990
1985
|
}
|
|
1991
1986
|
|
|
1987
|
+
// src/deployment/secret-redaction/redact-path/literal-rendering.ts
|
|
1988
|
+
function positionByLiteralRendering(bag, source, secrets, rules, scan) {
|
|
1989
|
+
if (rules.sourceIsTemplate !== true || typeof bag !== "string") return void 0;
|
|
1990
|
+
if (suspended > 0) return void 0;
|
|
1991
|
+
if (!isPlainObject(source)) return void 0;
|
|
1992
|
+
visits = 0;
|
|
1993
|
+
walking = secrets;
|
|
1994
|
+
try {
|
|
1995
|
+
return renderLeaf(bag, source, secrets, scan);
|
|
1996
|
+
} finally {
|
|
1997
|
+
walking = void 0;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
function renderLeaf(bag, source, secrets, scan) {
|
|
2001
|
+
const plaintextOf = tokenPlaintexts(secrets);
|
|
2002
|
+
const recorded = [...secrets.keys()];
|
|
2003
|
+
const copies = [...physicalNameCopiesOf.get(secrets) ?? []];
|
|
2004
|
+
const ifArgs = source["Fn::If"];
|
|
2005
|
+
if (Object.keys(source).length === 1 && Array.isArray(ifArgs)) {
|
|
2006
|
+
if (ifArgs.length !== 3) return void 0;
|
|
2007
|
+
const taken = takenIfBranchOf(secrets, source);
|
|
2008
|
+
if (taken !== void 0) {
|
|
2009
|
+
const branch = taken ? ifArgs[1] : ifArgs[2];
|
|
2010
|
+
if (isNoValue(branch)) return void 0;
|
|
2011
|
+
const segments = renderSegments(branch, 1);
|
|
2012
|
+
return segments === void 0 ? void 0 : placeAnchors(segments, plaintextOf, bag, scan, recorded, copies);
|
|
2013
|
+
}
|
|
2014
|
+
const spellings = /* @__PURE__ */ new Set();
|
|
2015
|
+
for (const branch of [ifArgs[1], ifArgs[2]]) {
|
|
2016
|
+
if (isNoValue(branch)) continue;
|
|
2017
|
+
const segments = renderSegments(branch, 1);
|
|
2018
|
+
if (segments === void 0 || segments.some((s) => "gap" in s)) return void 0;
|
|
2019
|
+
const spelled = placeAnchors(segments, plaintextOf, bag, scan, recorded, copies);
|
|
2020
|
+
if (spelled !== void 0) spellings.add(spelled);
|
|
2021
|
+
}
|
|
2022
|
+
return spellings.size === 1 ? [...spellings][0] : void 0;
|
|
2023
|
+
}
|
|
2024
|
+
const segments = renderSegments(source, 0);
|
|
2025
|
+
if (segments === void 0) return void 0;
|
|
2026
|
+
return placeAnchors(segments, plaintextOf, bag, scan, recorded, copies);
|
|
2027
|
+
}
|
|
2028
|
+
function staticTemplateText(node) {
|
|
2029
|
+
const outer = walking;
|
|
2030
|
+
const outerVisits = visits;
|
|
2031
|
+
walking = void 0;
|
|
2032
|
+
let segments;
|
|
2033
|
+
try {
|
|
2034
|
+
segments = renderSegments(node, 0);
|
|
2035
|
+
} finally {
|
|
2036
|
+
walking = outer;
|
|
2037
|
+
visits = outerVisits;
|
|
2038
|
+
}
|
|
2039
|
+
if (segments === void 0) return void 0;
|
|
2040
|
+
let text = "";
|
|
2041
|
+
for (const segment of segments) {
|
|
2042
|
+
if (!("text" in segment)) return void 0;
|
|
2043
|
+
text += segment.text;
|
|
2044
|
+
}
|
|
2045
|
+
return text;
|
|
2046
|
+
}
|
|
2047
|
+
let walking;
|
|
2048
|
+
let suspended = 0;
|
|
2049
|
+
function withoutLiteralRendering(run) {
|
|
2050
|
+
suspended++;
|
|
2051
|
+
try {
|
|
2052
|
+
return run();
|
|
2053
|
+
} finally {
|
|
2054
|
+
suspended--;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
function placeAnchors(segments, plaintextOf, bag, scan, plaintexts, physicalNameCopies) {
|
|
2058
|
+
const anchors = [];
|
|
2059
|
+
let leadingGap = false;
|
|
2060
|
+
let trailingGap = false;
|
|
2061
|
+
let current;
|
|
2062
|
+
for (const segment of segments) {
|
|
2063
|
+
if ("gap" in segment) {
|
|
2064
|
+
if (current !== void 0) {
|
|
2065
|
+
anchors.push(current);
|
|
2066
|
+
current = void 0;
|
|
2067
|
+
} else if (anchors.length === 0) leadingGap = true;
|
|
2068
|
+
trailingGap = true;
|
|
2069
|
+
continue;
|
|
2070
|
+
}
|
|
2071
|
+
trailingGap = false;
|
|
2072
|
+
current ??= {
|
|
2073
|
+
rendered: "",
|
|
2074
|
+
persisted: ""
|
|
2075
|
+
};
|
|
2076
|
+
if ("text" in segment) {
|
|
2077
|
+
current.rendered += segment.text;
|
|
2078
|
+
current.persisted += segment.text;
|
|
2079
|
+
} else {
|
|
2080
|
+
const plaintext = plaintextOf.get(segment.token);
|
|
2081
|
+
if (plaintext === void 0) return void 0;
|
|
2082
|
+
current.rendered += plaintext;
|
|
2083
|
+
current.persisted += segment.token;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
if (current !== void 0) anchors.push(current);
|
|
2087
|
+
if (!leadingGap && !trailingGap && anchors.length <= 1) {
|
|
2088
|
+
const only = anchors[0] ?? {
|
|
2089
|
+
rendered: "",
|
|
2090
|
+
persisted: ""
|
|
2091
|
+
};
|
|
2092
|
+
return only.rendered === bag ? only.persisted : void 0;
|
|
2093
|
+
}
|
|
2094
|
+
if (!anchors.some((a) => a.rendered.length > 0)) return void 0;
|
|
2095
|
+
const leftmost = placements(anchors, bag, leadingGap, trailingGap, "left");
|
|
2096
|
+
const rightmost = placements(anchors, bag, leadingGap, trailingGap, "right");
|
|
2097
|
+
if (leftmost === void 0 || rightmost === void 0) return void 0;
|
|
2098
|
+
if (leftmost.some((at, i) => at !== rightmost[i])) return void 0;
|
|
2099
|
+
const gaps = [];
|
|
2100
|
+
const gapRanges = [];
|
|
2101
|
+
let persisted = "";
|
|
2102
|
+
let cursor = 0;
|
|
2103
|
+
for (let i = 0; i < anchors.length; i++) {
|
|
2104
|
+
const at = leftmost[i];
|
|
2105
|
+
if (i > 0 || leadingGap) {
|
|
2106
|
+
const gap = bag.slice(cursor, at);
|
|
2107
|
+
gaps.push(gap);
|
|
2108
|
+
gapRanges.push([cursor, at]);
|
|
2109
|
+
persisted += gap;
|
|
2110
|
+
} else if (at !== 0) return;
|
|
2111
|
+
persisted += anchors[i].persisted;
|
|
2112
|
+
cursor = at + anchors[i].rendered.length;
|
|
2113
|
+
}
|
|
2114
|
+
if (trailingGap) {
|
|
2115
|
+
const gap = bag.slice(cursor);
|
|
2116
|
+
gaps.push(gap);
|
|
2117
|
+
gapRanges.push([cursor, bag.length]);
|
|
2118
|
+
persisted += gap;
|
|
2119
|
+
} else if (cursor !== bag.length) return;
|
|
2120
|
+
if (gaps.some((gap) => scan(gap) !== gap)) return void 0;
|
|
2121
|
+
const copyRanges = [];
|
|
2122
|
+
for (const copy of physicalNameCopies) {
|
|
2123
|
+
if (copy === "") continue;
|
|
2124
|
+
for (let at = bag.indexOf(copy); at !== -1; at = bag.indexOf(copy, at + 1)) copyRanges.push([at, at + copy.length]);
|
|
2125
|
+
}
|
|
2126
|
+
for (const plaintext of plaintexts) {
|
|
2127
|
+
if (plaintext === "") continue;
|
|
2128
|
+
for (let at = bag.indexOf(plaintext); at !== -1; at = bag.indexOf(plaintext, at + 1)) {
|
|
2129
|
+
const end = at + plaintext.length;
|
|
2130
|
+
if (!gapRanges.some(([from, to]) => at < to && end > from)) continue;
|
|
2131
|
+
if (!copyRanges.some(([from, to]) => at >= from && end <= to && gapRanges.some(([g0, g1]) => from >= g0 && to <= g1))) return void 0;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
return persisted;
|
|
2135
|
+
}
|
|
2136
|
+
function placements(anchors, bag, leadingGap, trailingGap, side) {
|
|
2137
|
+
const out = new Array(anchors.length);
|
|
2138
|
+
if (side === "left") {
|
|
2139
|
+
let cursor = 0;
|
|
2140
|
+
for (let i = 0; i < anchors.length; i++) {
|
|
2141
|
+
const text = anchors[i].rendered;
|
|
2142
|
+
const pinnedStart = i === 0 && !leadingGap;
|
|
2143
|
+
const pinnedEnd = i === anchors.length - 1 && !trailingGap;
|
|
2144
|
+
let at;
|
|
2145
|
+
if (pinnedStart) at = 0;
|
|
2146
|
+
else if (pinnedEnd) at = bag.length - text.length;
|
|
2147
|
+
else at = bag.indexOf(text, cursor);
|
|
2148
|
+
if (at < cursor || bag.slice(at, at + text.length) !== text) return void 0;
|
|
2149
|
+
if (pinnedEnd && at + text.length !== bag.length) return void 0;
|
|
2150
|
+
out[i] = at;
|
|
2151
|
+
cursor = at + text.length;
|
|
2152
|
+
}
|
|
2153
|
+
return out;
|
|
2154
|
+
}
|
|
2155
|
+
let limit = bag.length;
|
|
2156
|
+
for (let i = anchors.length - 1; i >= 0; i--) {
|
|
2157
|
+
const text = anchors[i].rendered;
|
|
2158
|
+
const pinnedStart = i === 0 && !leadingGap;
|
|
2159
|
+
const pinnedEnd = i === anchors.length - 1 && !trailingGap;
|
|
2160
|
+
let at;
|
|
2161
|
+
if (pinnedEnd) at = bag.length - text.length;
|
|
2162
|
+
else if (pinnedStart) at = 0;
|
|
2163
|
+
else at = limit - text.length < 0 ? -1 : bag.lastIndexOf(text, limit - text.length);
|
|
2164
|
+
if (at < 0 || at + text.length > limit || bag.slice(at, at + text.length) !== text) return;
|
|
2165
|
+
if (pinnedStart && at !== 0) return void 0;
|
|
2166
|
+
out[i] = at;
|
|
2167
|
+
limit = at;
|
|
2168
|
+
}
|
|
2169
|
+
return out;
|
|
2170
|
+
}
|
|
2171
|
+
function isNoValue(node) {
|
|
2172
|
+
return isPlainObject(node) && Object.keys(node).length === 1 && node["Ref"] === "AWS::NoValue";
|
|
2173
|
+
}
|
|
2174
|
+
const MAX_DEPTH = 16;
|
|
2175
|
+
const GAP = [{ gap: true }];
|
|
2176
|
+
const MAX_SEGMENTS = 512;
|
|
2177
|
+
const MAX_VISITS = 4096;
|
|
2178
|
+
let visits = 0;
|
|
2179
|
+
function renderSegments(node, depth) {
|
|
2180
|
+
if (depth === 0) visits = 0;
|
|
2181
|
+
if (++visits > MAX_VISITS) return void 0;
|
|
2182
|
+
if (depth > MAX_DEPTH) return void 0;
|
|
2183
|
+
if (typeof node === "string") return stringSegments(node);
|
|
2184
|
+
if (typeof node === "number" || typeof node === "boolean") return [{ text: String(node) }];
|
|
2185
|
+
if (!isPlainObject(node) || Object.keys(node).length !== 1) return GAP;
|
|
2186
|
+
const [key] = Object.keys(node);
|
|
2187
|
+
const args = node[key];
|
|
2188
|
+
if (key === "Fn::Join") {
|
|
2189
|
+
if (!Array.isArray(args) || args.length !== 2) return GAP;
|
|
2190
|
+
const [delimiter, list] = args;
|
|
2191
|
+
if (typeof delimiter !== "string" || !Array.isArray(list)) return GAP;
|
|
2192
|
+
const glue = stringSegments(delimiter);
|
|
2193
|
+
if (glue === void 0) return void 0;
|
|
2194
|
+
const out = [];
|
|
2195
|
+
const parts = list;
|
|
2196
|
+
for (let i = 0; i < parts.length; i++) {
|
|
2197
|
+
if (i > 0) out.push(...glue);
|
|
2198
|
+
const part = renderSegments(parts[i], depth + 1);
|
|
2199
|
+
if (part === void 0) return void 0;
|
|
2200
|
+
out.push(...part);
|
|
2201
|
+
if (out.length > MAX_SEGMENTS) return void 0;
|
|
2202
|
+
}
|
|
2203
|
+
return out;
|
|
2204
|
+
}
|
|
2205
|
+
if (key === "Fn::Sub") {
|
|
2206
|
+
if (typeof args === "string") return subSegments(args, {}, depth);
|
|
2207
|
+
if (Array.isArray(args) && args.length === 2 && typeof args[0] === "string") {
|
|
2208
|
+
const variables = args[1];
|
|
2209
|
+
if (!isPlainObject(variables)) return GAP;
|
|
2210
|
+
return subSegments(args[0], variables, depth);
|
|
2211
|
+
}
|
|
2212
|
+
return GAP;
|
|
2213
|
+
}
|
|
2214
|
+
if (key === "Fn::If") {
|
|
2215
|
+
const taken = walking === void 0 ? void 0 : takenIfBranchOf(walking, node);
|
|
2216
|
+
if (taken === void 0 || !Array.isArray(args) || args.length !== 3) return GAP;
|
|
2217
|
+
const branch = taken ? args[1] : args[2];
|
|
2218
|
+
return isNoValue(branch) ? GAP : renderSegments(branch, depth + 1);
|
|
2219
|
+
}
|
|
2220
|
+
if (key === "Fn::Select") {
|
|
2221
|
+
if (!Array.isArray(args) || args.length !== 2) return GAP;
|
|
2222
|
+
const index = typeof args[0] === "number" ? args[0] : typeof args[0] === "string" && /^\d+$/.test(args[0]) ? Number(args[0]) : void 0;
|
|
2223
|
+
const list = staticList(args[1]);
|
|
2224
|
+
if (index === void 0 || list === void 0 || index >= list.length) return GAP;
|
|
2225
|
+
return renderSegments(list[index], depth + 1);
|
|
2226
|
+
}
|
|
2227
|
+
return GAP;
|
|
2228
|
+
}
|
|
2229
|
+
function staticList(node) {
|
|
2230
|
+
if (Array.isArray(node)) return node;
|
|
2231
|
+
if (!isPlainObject(node) || Object.keys(node).length !== 1) return void 0;
|
|
2232
|
+
const split = node["Fn::Split"];
|
|
2233
|
+
if (!Array.isArray(split) || split.length !== 2) return void 0;
|
|
2234
|
+
const [delimiter, text] = split;
|
|
2235
|
+
if (typeof delimiter !== "string" || delimiter === "" || typeof text !== "string") return void 0;
|
|
2236
|
+
if (text.includes("{{resolve:")) return void 0;
|
|
2237
|
+
return text.split(delimiter);
|
|
2238
|
+
}
|
|
2239
|
+
function subSegments(text, variables, depth) {
|
|
2240
|
+
const out = [];
|
|
2241
|
+
let at = 0;
|
|
2242
|
+
for (const match of text.matchAll(/\$\{([^}]*)\}/g)) {
|
|
2243
|
+
const literal = stringSegments(text.slice(at, match.index));
|
|
2244
|
+
if (literal === void 0) return void 0;
|
|
2245
|
+
out.push(...literal);
|
|
2246
|
+
const name = match[1];
|
|
2247
|
+
if (name.startsWith("!")) out.push({ text: `\${${name.slice(1)}}` });
|
|
2248
|
+
else if (Object.hasOwn(variables, name)) {
|
|
2249
|
+
const part = renderSegments(variables[name], depth + 1);
|
|
2250
|
+
if (part === void 0) return void 0;
|
|
2251
|
+
out.push(...part);
|
|
2252
|
+
if (out.length > MAX_SEGMENTS) return void 0;
|
|
2253
|
+
} else out.push({ gap: true });
|
|
2254
|
+
at = match.index + match[0].length;
|
|
2255
|
+
}
|
|
2256
|
+
const rest = stringSegments(text.slice(at));
|
|
2257
|
+
if (rest === void 0) return void 0;
|
|
2258
|
+
out.push(...rest);
|
|
2259
|
+
return out;
|
|
2260
|
+
}
|
|
2261
|
+
function stringSegments(value) {
|
|
2262
|
+
const out = [];
|
|
2263
|
+
let at = 0;
|
|
2264
|
+
for (const span of dynamicReferenceSpans(value)) {
|
|
2265
|
+
const text = value.slice(at, span.start);
|
|
2266
|
+
if (text.includes("{{resolve:")) return void 0;
|
|
2267
|
+
if (text !== "") out.push({ text });
|
|
2268
|
+
out.push({ token: value.slice(span.start, span.end) });
|
|
2269
|
+
at = span.end;
|
|
2270
|
+
}
|
|
2271
|
+
const rest = value.slice(at);
|
|
2272
|
+
if (rest.includes("{{resolve:")) return void 0;
|
|
2273
|
+
if (rest !== "") out.push({ text: rest });
|
|
2274
|
+
return out;
|
|
2275
|
+
}
|
|
2276
|
+
function tokenPlaintexts(secrets) {
|
|
2277
|
+
const out = /* @__PURE__ */ new Map();
|
|
2278
|
+
const ambiguous = /* @__PURE__ */ new Set();
|
|
2279
|
+
for (const [token, plaintext] of secretRerenderPairs(secrets)) {
|
|
2280
|
+
const known = out.get(token);
|
|
2281
|
+
if (known !== void 0 && known !== plaintext) ambiguous.add(token);
|
|
2282
|
+
else out.set(token, plaintext);
|
|
2283
|
+
}
|
|
2284
|
+
for (const token of ambiguous) out.delete(token);
|
|
2285
|
+
return out;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
// src/deployment/secret-redaction/redact-path/baseline-mask.ts
|
|
2289
|
+
function isUncertifiedBaselineMaskPosition(properties, path) {
|
|
2290
|
+
if (pathCrossesDottedKey(properties, path)) return false;
|
|
2291
|
+
const [head] = path.split(".");
|
|
2292
|
+
if (head !== void 0 && RENDERED_DEFINITION_KEYS.has(head)) return definitionSourceCarriesSecret(properties);
|
|
2293
|
+
let cursor = properties;
|
|
2294
|
+
for (const segment of path.split(".")) {
|
|
2295
|
+
if (typeof cursor === "string") break;
|
|
2296
|
+
if (cursor === null || typeof cursor !== "object" || Array.isArray(cursor) || !Object.hasOwn(cursor, segment)) return false;
|
|
2297
|
+
cursor = cursor[segment];
|
|
2298
|
+
}
|
|
2299
|
+
if (typeof cursor === "string") return isDynamicReferenceString(cursor) && cursor !== "***";
|
|
2300
|
+
return subtreeHasDynamicReference(cursor) && !carriesSecretMask(cursor);
|
|
2301
|
+
}
|
|
2302
|
+
|
|
1992
2303
|
// src/deployment/secret-redaction/redact-path.ts
|
|
1993
2304
|
function redactByPath(bag, source, secrets, rules, secretExpressions, bagIsSameGeneration) {
|
|
1994
2305
|
if (isDynamicReferenceString(source) && typeof bag === "string") {
|
|
@@ -2004,8 +2315,8 @@ function redactByPath(bag, source, secrets, rules, secretExpressions, bagIsSameG
|
|
|
2004
2315
|
}
|
|
2005
2316
|
return positionByEmbeddedSpan(bag, source, secrets, bagIsSameGeneration);
|
|
2006
2317
|
}
|
|
2007
|
-
if (isSourcePlainLiteral(bag, source,
|
|
2008
|
-
const rerendered = rerenderedSourceLiteral(bag, source, secrets);
|
|
2318
|
+
if (isSourcePlainLiteral(bag, source, rules)) return bag;
|
|
2319
|
+
const rerendered = rerenderedSourceLiteral(bag, source, secrets, rules);
|
|
2009
2320
|
if (rerendered !== void 0) return rerendered;
|
|
2010
2321
|
if ((typeof bag === "string" || Array.isArray(bag)) && isPlainObject(source)) {
|
|
2011
2322
|
const inherited = positionByInheritedParameter(bag, source, secrets);
|
|
@@ -2014,6 +2325,11 @@ function redactByPath(bag, source, secrets, rules, secretExpressions, bagIsSameG
|
|
|
2014
2325
|
if (reread !== void 0) return reread;
|
|
2015
2326
|
}
|
|
2016
2327
|
if (typeof bag === "string" && isPlainObject(source)) {
|
|
2328
|
+
const rendered = positionByLiteralRendering(bag, source, secrets, rules, (text) => redactForState(text, {
|
|
2329
|
+
provenance: "value-scan",
|
|
2330
|
+
secrets
|
|
2331
|
+
}));
|
|
2332
|
+
if (rendered !== void 0) return rendered;
|
|
2017
2333
|
const certified = positionByCrossStackSource(bag, source, secrets);
|
|
2018
2334
|
if (certified !== void 0) return certified;
|
|
2019
2335
|
const placeheld = positionByParameterPlaceholders(bag, source, secrets);
|
|
@@ -4551,6 +4867,12 @@ function elastiCacheLeftSingleAzWithoutZones(siblings) {
|
|
|
4551
4867
|
const { oldProperties: prev, newProperties: next } = siblings;
|
|
4552
4868
|
return prev["Engine"] === "memcached" && next["Engine"] === "memcached" && prev["PreferredAvailabilityZone"] == null && next["PreferredAvailabilityZone"] == null && next["PreferredAvailabilityZones"] == null && (next["AZMode"] == null || next["AZMode"] === "single-az");
|
|
4553
4869
|
}
|
|
4870
|
+
function elastiCacheMovedSingleToCrossAz(siblings) {
|
|
4871
|
+
if (siblings === void 0) return false;
|
|
4872
|
+
const { oldProperties: prev, newProperties: next } = siblings;
|
|
4873
|
+
const zones = next["PreferredAvailabilityZones"];
|
|
4874
|
+
return prev["Engine"] === "memcached" && next["Engine"] === "memcached" && prev["AZMode"] === "single-az" && next["AZMode"] === "cross-az" && prev["PreferredAvailabilityZone"] == null && next["PreferredAvailabilityZone"] == null && prev["PreferredAvailabilityZones"] == null && Array.isArray(zones) && zones.every((z) => typeof z === "string") && new Set(zones).size >= 2 && isDeepStrictEqual(prev["NumCacheNodes"], next["NumCacheNodes"]) && zones.length === Number(next["NumCacheNodes"]);
|
|
4875
|
+
}
|
|
4554
4876
|
function elastiCacheAzModeRemovedFromSingleAz(oldValue, newValue, siblings) {
|
|
4555
4877
|
return oldValue === "single-az" && newValue == null && elastiCacheLeftSingleAzWithoutZones(siblings);
|
|
4556
4878
|
}
|
|
@@ -4558,7 +4880,7 @@ function elastiCachePreferredAvailabilityZonesRemovedFromSingleAz(oldValue, newV
|
|
|
4558
4880
|
return Array.isArray(oldValue) && oldValue.length > 0 && newValue == null && siblings?.oldProperties["AZMode"] === "single-az" && elastiCacheLeftSingleAzWithoutZones(siblings);
|
|
4559
4881
|
}
|
|
4560
4882
|
function elastiCachePreferredAvailabilityZonesReplaced(oldValue, newValue, siblings) {
|
|
4561
|
-
return elastiCachePreferredAvailabilityZonesMovedToDisjoint(oldValue, newValue) || elastiCachePreferredAvailabilityZonesRemovedFromSingleAz(oldValue, newValue, siblings);
|
|
4883
|
+
return elastiCachePreferredAvailabilityZonesMovedToDisjoint(oldValue, newValue) || elastiCachePreferredAvailabilityZonesRemovedFromSingleAz(oldValue, newValue, siblings) || oldValue == null && newValue != null && elastiCacheMovedSingleToCrossAz(siblings);
|
|
4562
4884
|
}
|
|
4563
4885
|
function emrClusterInstancesReplaced(oldValue, newValue) {
|
|
4564
4886
|
if (oldValue === void 0 && newValue === void 0) return true;
|
|
@@ -4637,6 +4959,157 @@ function ssmDocumentChangeReplaces(_oldValue, _newValue, siblings) {
|
|
|
4637
4959
|
return siblings?.newProperties["UpdateMethod"] !== "NewVersion";
|
|
4638
4960
|
}
|
|
4639
4961
|
|
|
4962
|
+
// src/deployment/deploy-value-equality.ts
|
|
4963
|
+
function isReplacementCeiling(pc) {
|
|
4964
|
+
return pc.requiresReplacement && (pc.inPlacePropagated === true || pc.replacementPropagated === true);
|
|
4965
|
+
}
|
|
4966
|
+
function keyOrderFreeJson(value) {
|
|
4967
|
+
return JSON.stringify(value, (_key, node) => {
|
|
4968
|
+
if (node === null || typeof node !== "object" || Array.isArray(node)) return node;
|
|
4969
|
+
const sorted = Object.create(null);
|
|
4970
|
+
for (const key of Object.keys(node).sort()) sorted[key] = node[key];
|
|
4971
|
+
return sorted;
|
|
4972
|
+
});
|
|
4973
|
+
}
|
|
4974
|
+
const IAM_ACTION = /^[a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128}$/;
|
|
4975
|
+
const ACTION_IN_MESSAGE = [/\bperform:\s*([a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128})(?=\s|$|[.,;])/, /\ballows the ([a-z0-9-]{1,64}:[A-Za-z0-9*]{1,128}) action\b/];
|
|
4976
|
+
const DENIAL_CLASSES = /* @__PURE__ */ new Set([
|
|
4977
|
+
"AccessDenied",
|
|
4978
|
+
"AccessDeniedException",
|
|
4979
|
+
"AuthorizationError",
|
|
4980
|
+
"UnauthorizedOperation"
|
|
4981
|
+
]);
|
|
4982
|
+
function readDenialOf(error) {
|
|
4983
|
+
try {
|
|
4984
|
+
const name = error?.name;
|
|
4985
|
+
if (typeof name !== "string" || !DENIAL_CLASSES.has(name)) return void 0;
|
|
4986
|
+
const message = error.message;
|
|
4987
|
+
let action;
|
|
4988
|
+
if (typeof message === "string") for (const pattern of ACTION_IN_MESSAGE) {
|
|
4989
|
+
const found = pattern.exec(message)?.[1];
|
|
4990
|
+
if (found !== void 0 && IAM_ACTION.test(found)) {
|
|
4991
|
+
action = found;
|
|
4992
|
+
break;
|
|
4993
|
+
}
|
|
4994
|
+
}
|
|
4995
|
+
return {
|
|
4996
|
+
...action !== void 0 && { action },
|
|
4997
|
+
errorClass: name
|
|
4998
|
+
};
|
|
4999
|
+
} catch {
|
|
5000
|
+
return;
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
function grantSentence(denied) {
|
|
5004
|
+
const what = denied.action !== void 0 ? `the ${denied.action} permission` : `the read permission the provider's readback of this resource type needs`;
|
|
5005
|
+
return `AWS denied the read${denied.errorClass !== void 0 ? ` (${denied.errorClass})` : ""}, and re-running would be denied the same way: grant ${what} to the credentials cdkd runs with, then re-run`;
|
|
5006
|
+
}
|
|
5007
|
+
function liveHoldsFreshLeaves(live, leaves) {
|
|
5008
|
+
for (const leaf of leaves) {
|
|
5009
|
+
let node = live;
|
|
5010
|
+
for (const segment of leaf.path) {
|
|
5011
|
+
if (typeof segment === "number") {
|
|
5012
|
+
if (!Array.isArray(node) || segment >= node.length) return false;
|
|
5013
|
+
node = node[segment];
|
|
5014
|
+
continue;
|
|
5015
|
+
}
|
|
5016
|
+
if (node === null || typeof node !== "object" || Array.isArray(node)) return false;
|
|
5017
|
+
if (!Object.prototype.hasOwnProperty.call(node, segment)) return false;
|
|
5018
|
+
node = node[segment];
|
|
5019
|
+
}
|
|
5020
|
+
if (typeof leaf.plaintext === "string") {
|
|
5021
|
+
if (typeof node !== "string" || node !== leaf.plaintext) return false;
|
|
5022
|
+
} else if (node === void 0 || keyOrderFreeJson(node) !== keyOrderFreeJson(leaf.plaintext)) return false;
|
|
5023
|
+
}
|
|
5024
|
+
return true;
|
|
5025
|
+
}
|
|
5026
|
+
function outputMapsEqual(a, b) {
|
|
5027
|
+
return deepEqualValue(a, b);
|
|
5028
|
+
}
|
|
5029
|
+
function deepEqualValue(a, b) {
|
|
5030
|
+
if (a === b) return true;
|
|
5031
|
+
if (a == null || b == null) return a === b;
|
|
5032
|
+
if (typeof a !== typeof b) return false;
|
|
5033
|
+
if (typeof a !== "object") return false;
|
|
5034
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
5035
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
5036
|
+
return a.every((v, i) => deepEqualValue(v, b[i]));
|
|
5037
|
+
}
|
|
5038
|
+
const ao = a;
|
|
5039
|
+
const bo = b;
|
|
5040
|
+
const ak = Object.keys(ao);
|
|
5041
|
+
if (ak.length !== Object.keys(bo).length) return false;
|
|
5042
|
+
for (const k of ak) {
|
|
5043
|
+
if (!Object.prototype.hasOwnProperty.call(bo, k)) return false;
|
|
5044
|
+
if (!deepEqualValue(ao[k], bo[k])) return false;
|
|
5045
|
+
}
|
|
5046
|
+
return true;
|
|
5047
|
+
}
|
|
5048
|
+
|
|
5049
|
+
// src/analyzer/replacement-rules/rds-immutability.ts
|
|
5050
|
+
const UNRESOLVED = Symbol("unresolved");
|
|
5051
|
+
const UNDECIDABLE = Symbol("undecidable");
|
|
5052
|
+
function javaString(value) {
|
|
5053
|
+
if (value === void 0 || value === null) return null;
|
|
5054
|
+
return typeof value === "string" ? value : UNRESOLVED;
|
|
5055
|
+
}
|
|
5056
|
+
function stringChange(oldValue, newValue) {
|
|
5057
|
+
if (oldValue === void 0 && newValue === void 0) return {
|
|
5058
|
+
before: UNRESOLVED,
|
|
5059
|
+
after: UNRESOLVED,
|
|
5060
|
+
equal: false
|
|
5061
|
+
};
|
|
5062
|
+
const before = javaString(oldValue);
|
|
5063
|
+
const after = javaString(newValue);
|
|
5064
|
+
return {
|
|
5065
|
+
before,
|
|
5066
|
+
after,
|
|
5067
|
+
equal: before === UNRESOLVED && after === UNRESOLVED ? keyOrderFreeJson(oldValue) === keyOrderFreeJson(newValue) : before === after
|
|
5068
|
+
};
|
|
5069
|
+
}
|
|
5070
|
+
function javaBoolean(value) {
|
|
5071
|
+
if (value === void 0 || value === null) return null;
|
|
5072
|
+
if (value === true || value === "true") return true;
|
|
5073
|
+
if (value === false || value === "false") return false;
|
|
5074
|
+
return UNDECIDABLE;
|
|
5075
|
+
}
|
|
5076
|
+
const isNullOrEmpty = (value) => value === null || value === "";
|
|
5077
|
+
function dbInstanceRestoreInputChangeReplaces(oldValue, newValue) {
|
|
5078
|
+
const { after, equal } = stringChange(oldValue, newValue);
|
|
5079
|
+
return !equal && !isNullOrEmpty(after);
|
|
5080
|
+
}
|
|
5081
|
+
function dbInstanceUseLatestRestorableTimeChangeReplaces(oldValue, newValue) {
|
|
5082
|
+
if (oldValue === void 0 && newValue === void 0) return true;
|
|
5083
|
+
const before = javaBoolean(oldValue);
|
|
5084
|
+
const after = javaBoolean(newValue);
|
|
5085
|
+
if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
|
|
5086
|
+
return before !== after && after === true;
|
|
5087
|
+
}
|
|
5088
|
+
function dbInstanceReplicaSourceChangeReplaces(oldValue, newValue) {
|
|
5089
|
+
const { before, after, equal } = stringChange(oldValue, newValue);
|
|
5090
|
+
if (equal) return false;
|
|
5091
|
+
return !(!isNullOrEmpty(before) && isNullOrEmpty(after));
|
|
5092
|
+
}
|
|
5093
|
+
function dbInstancePerformanceInsightsKmsKeyChangeReplaces(oldValue, newValue) {
|
|
5094
|
+
const { before, equal } = stringChange(oldValue, newValue);
|
|
5095
|
+
return !isNullOrEmpty(before) && !equal;
|
|
5096
|
+
}
|
|
5097
|
+
function dbInstanceAvailabilityZoneChangeReplaces(oldValue, newValue, siblings) {
|
|
5098
|
+
const { after, equal } = stringChange(oldValue, newValue);
|
|
5099
|
+
if (equal) return false;
|
|
5100
|
+
if (isNullOrEmpty(after)) {
|
|
5101
|
+
if (siblings === void 0) return false;
|
|
5102
|
+
const multiAz = javaBoolean(siblings.newProperties["MultiAZ"]);
|
|
5103
|
+
if (multiAz === UNDECIDABLE || multiAz === true) return false;
|
|
5104
|
+
}
|
|
5105
|
+
return true;
|
|
5106
|
+
}
|
|
5107
|
+
function dbClusterGlobalClusterChangeReplaces(oldValue, newValue) {
|
|
5108
|
+
const { before, after, equal } = stringChange(oldValue, newValue);
|
|
5109
|
+
if (!isNullOrEmpty(before) && isNullOrEmpty(after)) return false;
|
|
5110
|
+
return !equal;
|
|
5111
|
+
}
|
|
5112
|
+
|
|
4640
5113
|
// src/analyzer/replacement-rules/rules.ts
|
|
4641
5114
|
function initializeRules() {
|
|
4642
5115
|
this.rules.set("AWS::S3::Bucket", {
|
|
@@ -4977,11 +5450,23 @@ function initializeRules() {
|
|
|
4977
5450
|
});
|
|
4978
5451
|
this.rules.set("AWS::RDS::DBCluster", {
|
|
4979
5452
|
replacementProperties: /* @__PURE__ */ new Set(),
|
|
4980
|
-
conditionalReplacements: /* @__PURE__ */ new Map([["Engine", dbClusterEngineChangeReplaces]])
|
|
5453
|
+
conditionalReplacements: /* @__PURE__ */ new Map([["Engine", dbClusterEngineChangeReplaces], ["GlobalClusterIdentifier", dbClusterGlobalClusterChangeReplaces]])
|
|
4981
5454
|
});
|
|
4982
5455
|
this.rules.set("AWS::RDS::DBInstance", {
|
|
4983
5456
|
replacementProperties: /* @__PURE__ */ new Set(),
|
|
4984
|
-
conditionalReplacements: /* @__PURE__ */ new Map([
|
|
5457
|
+
conditionalReplacements: /* @__PURE__ */ new Map([
|
|
5458
|
+
["Engine", dbInstanceEngineChangeReplaces],
|
|
5459
|
+
["AvailabilityZone", dbInstanceAvailabilityZoneChangeReplaces],
|
|
5460
|
+
["PerformanceInsightsKMSKeyId", dbInstancePerformanceInsightsKmsKeyChangeReplaces],
|
|
5461
|
+
["SourceDBInstanceIdentifier", dbInstanceReplicaSourceChangeReplaces],
|
|
5462
|
+
["SourceDBClusterIdentifier", dbInstanceReplicaSourceChangeReplaces],
|
|
5463
|
+
["DBSnapshotIdentifier", dbInstanceRestoreInputChangeReplaces],
|
|
5464
|
+
["DBClusterSnapshotIdentifier", dbInstanceRestoreInputChangeReplaces],
|
|
5465
|
+
["RestoreTime", dbInstanceRestoreInputChangeReplaces],
|
|
5466
|
+
["SourceDBInstanceAutomatedBackupsArn", dbInstanceRestoreInputChangeReplaces],
|
|
5467
|
+
["SourceDbiResourceId", dbInstanceRestoreInputChangeReplaces],
|
|
5468
|
+
["UseLatestRestorableTime", dbInstanceUseLatestRestorableTimeChangeReplaces]
|
|
5469
|
+
])
|
|
4985
5470
|
});
|
|
4986
5471
|
this.rules.set("AWS::EC2::Subnet", {
|
|
4987
5472
|
replacementProperties: /* @__PURE__ */ new Set([
|
|
@@ -5004,7 +5489,6 @@ function initializeRules() {
|
|
|
5004
5489
|
});
|
|
5005
5490
|
this.rules.set("AWS::EC2::Instance", {
|
|
5006
5491
|
replacementProperties: /* @__PURE__ */ new Set([
|
|
5007
|
-
"EbsOptimized",
|
|
5008
5492
|
"AvailabilityZone",
|
|
5009
5493
|
"ImageId",
|
|
5010
5494
|
"SubnetId",
|
|
@@ -5020,6 +5504,7 @@ function initializeRules() {
|
|
|
5020
5504
|
"HostResourceGroupArn",
|
|
5021
5505
|
"SecurityGroups"
|
|
5022
5506
|
]),
|
|
5507
|
+
updateableProperties: /* @__PURE__ */ new Set(["EbsOptimized"]),
|
|
5023
5508
|
conditionalReplacements: /* @__PURE__ */ new Map([
|
|
5024
5509
|
["SecurityGroupIds", instanceSecurityGroupIdsChangeReplaces],
|
|
5025
5510
|
["BlockDeviceMappings", instanceBlockDeviceMappingsChangeReplaces],
|
|
@@ -5119,5 +5604,5 @@ var ReplacementRulesRegistry = class {
|
|
|
5119
5604
|
}
|
|
5120
5605
|
};
|
|
5121
5606
|
|
|
5122
|
-
export {
|
|
5123
|
-
//# sourceMappingURL=replacement-rules-
|
|
5607
|
+
export { recordSecretResolution as $, recordDroppedArrayElements as $t, readbackPathFor as A, isScopedSecretVerdict as An, withLegacyOverlapScan as At, isSameGenerationBag as B, recordNoEchoAttributeValues as Bn, staticTemplateText as Bt, noEchoComparison as C, splitGetAttStringForm as Cn, maskSecretsInError as Ct, noEchoParameterNodesAt as D, freshNoEchoValuesOf as Dn, legacyReferenceLeavesOnly as Dt, noEchoOutputsComparison as E, contradictProvenPublicExpression as En, legacyLeavesWithoutMask as Et, valueAtCoordinate as F, provenPublicValue as Fn, scrubResourceRecord as Ft, recordIntrinsicLeafResolutionAs as G, WHOLE_DYNAMIC_REFERENCE_PATTERN as Gn, secretRerenderPairs as Gt, markSameGenerationBag as H, recordProvenPublicExpression as Hn, dynamicReferenceSpans as Ht, witnessNormalize as I, recordDerivedMaskOnlyValue as In, withPhysicalNameCopies as It, mixedLiteralAnswered as J, maskMatchSpans as Jn, arrayPairsWhateverDrops as Jt, redactionClaimOf as K, isDynamicReferenceString as Kn, spelledKeysOf as Kt, liveMatchesUnresolvedTokenFrame as L, recordFreshNoEchoValuesIn as Ln, withoutPhysicalNameCopies as Lt, recordPassedNoEchoParameters as M, markNoEchoParameterClass as Mn, repairEmbeddedPhysicalNamesTowards as Mt, recordedNoEchoValuesOf as N, noEchoParameterPlaintextsOf as Nn, repairPhysicalNameCopyLeaves as Nt, noEchoParametersReadBy as O, isMaskOnlyPlaintext as On, overlapRuleAnswered as Ot, replaceAtCoordinates as P, pinScopedSecretVerdict as Pn, replaceEmbeddedPhysicalNameRewrites as Pt, openRecordingScope as Q, standsForInheritedSecret as Qt, carryRedactionMarks as R, recordMaskOnlyValue as Rn, spanNamesResolvableService as Rt, maskedLeafCoordinatesOf as S, recordCrossStackExpression as Sn, maskRecordedSecretsInText as St, noEchoLeavesOf as T, carryFreshNoEchoMark as Tn, differingStringLeaves as Tt, mergeResolvedPairs as U, wholeStringLeavesOf as Un, dynamicReferenceTokens as Ut, markLeafCertifiedBag as V, recordNoEchoParameterFreshValue as Vn, DYNAMIC_REFERENCE_TOKEN_SCAN as Vt, recordIntrinsicLeafResolution as W, withoutNoEchoParameterEntries as Wn, keepTemplateLiteralLeaves as Wt, redactForState as X, rereadParameterExpression as Xt, withLegacyMixedScan as Y, identityKeyFor as Yt, foldRecording as Z, splitOutsideDynamicReferences as Zt, canonicalJson as _, recordAttributeIdCopy as _n, recordLogOnlyValue as _t, liveHoldsFreshLeaves as a, inheritedParameterExpression as an, snapshotPassProvenance as at, maskReadbackAtCoordinates as b, nestedStackRowTagSpellingOf as bn, createSecretMasker as bt, blockDeviceMappingsDifferOnlyInDeleteOnTermination as c, recordInheritedParameterValue as cn, createUnionSecretMasker as ct, emrClusterInstancesReplaced as d, carriesFreshNoEchoValue as dn, literalSplitDelimitersOf as dt, recordTakenIfBranch as en, hasPassProvenance as et, canonicalLambdaFunctionName as f, embedsFreshNoEchoValue as fn, logOnlyValueCount as ft, canonicalCoordinates as g, physicalNameCopiesOf as gn, recordLogOnlySplitFragments as gt, sameLambdaFunctionAddress as h, recoverMaskedOutput as hn, recordLogOnlyParameterValue as ht, keyOrderFreeJson as i, inheritNestedStackParameterAssociations as in, recordReferenceResolution as it, readsNoEchoSource as j, isSecretExpressionByVerdictOrSpelling as jn, embeddedPhysicalNameRewrites as jt, passedNoEchoParametersOf as k, isNoEchoParameterPlaintext as kn, replaceWholeLeaves as kt, dbInstanceEngineChangeIsInPlace as l, redactInheritedParameterValue as ln, hasLogOnlyValues as lt, parseLambdaFunctionAddress as m, recordRecoverableMaskedOutput as mn, printingCorpusOf as mt, grantSentence as n, recordInheritedPseudoParameters as nn, passReadVersionsFor as nt, outputMapsEqual as o, inheritedRenderedToken as on, carryLogOnlyValues as ot, lambdaFunctionNameForMask as p, freshNoEchoLeafPositions as pn, logOnlyValuesOf as pt, resolvedPlaintextOf as q, isSingleDynamicReferenceToken as qn, pathCrossesDottedKey as qt, isReplacementCeiling as r, templateRereadsAccountId as rn, recordReferenceProvenanceEntry as rt, readDenialOf as s, recordInheritedParameterRead as sn, carryLogOnlyValuesCarriedBy as st, ReplacementRulesRegistry as t, inheritedPseudoValue as tn, passProvenanceFor as tt, ecsServiceLaunchTypeSetOrChanged as u, withdrawRenderedParameterSpelling as un, hasMaskableValues as ut, isMarkedCoordinate as v, recordPhysicalNameCopy as vn, shareLogOnlyValues as vt, noEchoCoordinatesOf as w, carriesSecretMask as wn, maskSecretsInText as wt, maskWholeValue as x, crossStackSourceKey as xn, errorCauseChain as xt, maskAtCoordinates as y, recordNestedStackParameterExpressions as yn, unionOfSecretBags as yt, intrinsicLeafResolutionOf as z, recordMaskOnlyValuesIn as zn, isUncertifiedBaselineMaskPosition as zt };
|
|
5608
|
+
//# sourceMappingURL=replacement-rules-BimJi0H1.js.map
|