@cdkd/cli 0.370.6 → 0.371.0

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.
Files changed (68) hide show
  1. package/dist/{ambient-client-defaults-znFaZS6t.js → ambient-client-defaults-DzKSQvWN.js} +3 -3
  2. package/dist/{ambient-client-defaults-znFaZS6t.js.map → ambient-client-defaults-DzKSQvWN.js.map} +1 -1
  3. package/dist/{asg-provider-CxUpkiE0.js → asg-provider-BkR7gv40.js} +8 -8
  4. package/dist/{asg-provider-CxUpkiE0.js.map → asg-provider-BkR7gv40.js.map} +1 -1
  5. package/dist/cli.js +3 -3
  6. package/dist/{created-resource-sink-_8-H2n_W.js → created-resource-sink-D7FufEaB.js} +4 -4
  7. package/dist/{created-resource-sink-_8-H2n_W.js.map → created-resource-sink-D7FufEaB.js.map} +1 -1
  8. package/dist/{custom-resource-runtime-8odRXut6.js → custom-resource-runtime-DyUvtovF.js} +6 -6
  9. package/dist/{custom-resource-runtime-8odRXut6.js.map → custom-resource-runtime-DyUvtovF.js.map} +1 -1
  10. package/dist/{db-associated-roles-D5lu-Ecp.js → db-associated-roles-Dq-VSmuu.js} +2 -2
  11. package/dist/{db-associated-roles-D5lu-Ecp.js.map → db-associated-roles-Dq-VSmuu.js.map} +1 -1
  12. package/dist/{delete-started-DU0_uilB.js → delete-started-C8fWcehI.js} +4 -4
  13. package/dist/{delete-started-DU0_uilB.js.map → delete-started-C8fWcehI.js.map} +1 -1
  14. package/dist/{deploy-engine-BfiEN_b4.js → deploy-engine-BsKzx9ys.js} +533 -76
  15. package/dist/deploy-engine-BsKzx9ys.js.map +1 -0
  16. package/dist/{ec2-termination-protection-dlIgSfnA.js → ec2-termination-protection-CJjU7OpO.js} +3 -3
  17. package/dist/{ec2-termination-protection-dlIgSfnA.js.map → ec2-termination-protection-CJjU7OpO.js.map} +1 -1
  18. package/dist/{ecr-uri-VJbNjmEC.js → ecr-uri-BYBZlAlS.js} +2 -2
  19. package/dist/{ecr-uri-VJbNjmEC.js.map → ecr-uri-BYBZlAlS.js.map} +1 -1
  20. package/dist/{emr-cluster-provider-B_wdviQS.js → emr-cluster-provider-Cz2_BHvv.js} +10 -10
  21. package/dist/{emr-cluster-provider-B_wdviQS.js.map → emr-cluster-provider-Cz2_BHvv.js.map} +1 -1
  22. package/dist/{expected-bucket-owner-DYvaQ-Zz.js → expected-bucket-owner-Dr7zxlJn.js} +2 -2
  23. package/dist/{expected-bucket-owner-DYvaQ-Zz.js.map → expected-bucket-owner-Dr7zxlJn.js.map} +1 -1
  24. package/dist/{iam-role-provider-NKcMOq1q.js → iam-role-provider-C27pVBaA.js} +12 -12
  25. package/dist/{iam-role-provider-NKcMOq1q.js.map → iam-role-provider-C27pVBaA.js.map} +1 -1
  26. package/dist/{identity-read-denied-HjFJxXlW.js → identity-read-denied-DHWVUHrX.js} +5 -5
  27. package/dist/{identity-read-denied-HjFJxXlW.js.map → identity-read-denied-DHWVUHrX.js.map} +1 -1
  28. package/dist/{image-plan-DiN9kLKu.js → image-plan-D2uTAfxX.js} +9 -9
  29. package/dist/{image-plan-DiN9kLKu.js.map → image-plan-D2uTAfxX.js.map} +1 -1
  30. package/dist/index.d.ts +32 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +5 -5
  33. package/dist/{logger-DUAQ_JOi.js → logger-DVdLGob_.js} +2 -2
  34. package/dist/{logger-DUAQ_JOi.js.map → logger-DVdLGob_.js.map} +1 -1
  35. package/dist/{neptune-provider-rkdfjnF9.js → neptune-provider-CkbTF9aG.js} +9 -9
  36. package/dist/{neptune-provider-rkdfjnF9.js.map → neptune-provider-CkbTF9aG.js.map} +1 -1
  37. package/dist/{program-Bad-xRVI.js → program-BBg-9V23.js} +305 -49
  38. package/dist/program-BBg-9V23.js.map +1 -0
  39. package/dist/{provider-classes-DAF9XM-4.js → provider-classes-DWi0yjHc.js} +395 -174
  40. package/dist/provider-classes-DWi0yjHc.js.map +1 -0
  41. package/dist/{rds-provider-DlFaFEyf.js → rds-provider-BV4XW4wv.js} +91 -23
  42. package/dist/rds-provider-BV4XW4wv.js.map +1 -0
  43. package/dist/{read-replica-BZjPCmIl.js → read-replica-B08_DZNH.js} +3 -3
  44. package/dist/{read-replica-BZjPCmIl.js.map → read-replica-B08_DZNH.js.map} +1 -1
  45. package/dist/{redacted-delete-address-CRTZ9dGr.js → redacted-delete-address-Be4d3ZWA.js} +4 -4
  46. package/dist/{redacted-delete-address-CRTZ9dGr.js.map → redacted-delete-address-Be4d3ZWA.js.map} +1 -1
  47. package/dist/{replacement-rules-BYsfga8b.js → replacement-rules-DL9MZWSp.js} +416 -30
  48. package/dist/replacement-rules-DL9MZWSp.js.map +1 -0
  49. package/dist/{resource-deadline-Ke4EXyCI.js → resource-deadline-D65EA80y.js} +2 -2
  50. package/dist/{resource-deadline-Ke4EXyCI.js.map → resource-deadline-D65EA80y.js.map} +1 -1
  51. package/dist/{restore-source-guard-DijUNuPT.js → restore-source-guard-ClcpxInI.js} +4 -4
  52. package/dist/{restore-source-guard-DijUNuPT.js.map → restore-source-guard-ClcpxInI.js.map} +1 -1
  53. package/dist/{run-cli-CuKwf0wJ.js → run-cli-zFQkbzGk.js} +2 -2
  54. package/dist/{run-cli-CuKwf0wJ.js.map → run-cli-zFQkbzGk.js.map} +1 -1
  55. package/dist/{secret-reference-immutable-C0y2leSj.js → secret-reference-immutable-Bh9gCLFt.js} +6 -6
  56. package/dist/{secret-reference-immutable-C0y2leSj.js.map → secret-reference-immutable-Bh9gCLFt.js.map} +1 -1
  57. package/dist/{settle-own-write-members-BeMLFzws.js → settle-own-write-members-B-g5oflo.js} +13 -13
  58. package/dist/{settle-own-write-members-BeMLFzws.js.map → settle-own-write-members-B-g5oflo.js.map} +1 -1
  59. package/dist/{tag-list-k_7QY2-3.js → tag-list-DX_Ke9se.js} +4 -4
  60. package/dist/{tag-list-k_7QY2-3.js.map → tag-list-DX_Ke9se.js.map} +1 -1
  61. package/dist/{version-BrLstCqx.js → version-G1wdb4QW.js} +2 -2
  62. package/dist/{version-BrLstCqx.js.map → version-G1wdb4QW.js.map} +1 -1
  63. package/package.json +2 -2
  64. package/dist/deploy-engine-BfiEN_b4.js.map +0 -1
  65. package/dist/program-Bad-xRVI.js.map +0 -1
  66. package/dist/provider-classes-DAF9XM-4.js.map +0 -1
  67. package/dist/rds-provider-DlFaFEyf.js.map +0 -1
  68. package/dist/replacement-rules-BYsfga8b.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { P as safeMsg, x as SAFE_MSG_ALTERED_CHAR } from "./version-BrLstCqx.js";
2
- import { n as getLogger } from "./logger-DUAQ_JOi.js";
1
+ import { P as safeMsg, x as SAFE_MSG_ALTERED_CHAR } from "./version-G1wdb4QW.js";
2
+ import { n as getLogger } from "./logger-DVdLGob_.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, secrets, rules) {
1899
- return rules.sourceIsTemplate === true && typeof bag === "string" && bag === source && !isDynamicReferenceString(source) && !secrets.has(bag);
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") return raw === template && !isDynamicReferenceString(raw) && !secrets.has(raw) && redacted !== "***" ? raw : redacted;
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, secrets, rules)) return bag;
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);
@@ -4637,6 +4953,64 @@ function ssmDocumentChangeReplaces(_oldValue, _newValue, siblings) {
4637
4953
  return siblings?.newProperties["UpdateMethod"] !== "NewVersion";
4638
4954
  }
4639
4955
 
4956
+ // src/analyzer/replacement-rules/rds-immutability.ts
4957
+ const UNDECIDABLE = Symbol("undecidable");
4958
+ function javaString(value) {
4959
+ if (value === void 0 || value === null) return null;
4960
+ return typeof value === "string" ? value : UNDECIDABLE;
4961
+ }
4962
+ function javaBoolean(value) {
4963
+ if (value === void 0 || value === null) return null;
4964
+ if (value === true || value === "true") return true;
4965
+ if (value === false || value === "false") return false;
4966
+ return UNDECIDABLE;
4967
+ }
4968
+ const isNullOrEmpty = (value) => value === null || value === "";
4969
+ function dbInstanceRestoreInputChangeReplaces(oldValue, newValue) {
4970
+ const before = javaString(oldValue);
4971
+ const after = javaString(newValue);
4972
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
4973
+ return before !== after && !isNullOrEmpty(after);
4974
+ }
4975
+ function dbInstanceUseLatestRestorableTimeChangeReplaces(oldValue, newValue) {
4976
+ const before = javaBoolean(oldValue);
4977
+ const after = javaBoolean(newValue);
4978
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
4979
+ return before !== after && after === true;
4980
+ }
4981
+ function dbInstanceReplicaSourceChangeReplaces(oldValue, newValue) {
4982
+ const before = javaString(oldValue);
4983
+ const after = javaString(newValue);
4984
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
4985
+ if (before === after) return false;
4986
+ return !(!isNullOrEmpty(before) && isNullOrEmpty(after));
4987
+ }
4988
+ function dbInstancePerformanceInsightsKmsKeyChangeReplaces(oldValue, newValue) {
4989
+ const before = javaString(oldValue);
4990
+ const after = javaString(newValue);
4991
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
4992
+ return !isNullOrEmpty(before) && before !== after;
4993
+ }
4994
+ function dbInstanceAvailabilityZoneChangeReplaces(oldValue, newValue, siblings) {
4995
+ const before = javaString(oldValue);
4996
+ const after = javaString(newValue);
4997
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
4998
+ if (before === after) return false;
4999
+ if (isNullOrEmpty(after)) {
5000
+ if (siblings === void 0) return false;
5001
+ const multiAz = javaBoolean(siblings.newProperties["MultiAZ"]);
5002
+ if (multiAz === UNDECIDABLE || multiAz === true) return false;
5003
+ }
5004
+ return true;
5005
+ }
5006
+ function dbClusterGlobalClusterChangeReplaces(oldValue, newValue) {
5007
+ const before = javaString(oldValue);
5008
+ const after = javaString(newValue);
5009
+ if (before === UNDECIDABLE || after === UNDECIDABLE) return false;
5010
+ if (!isNullOrEmpty(before) && isNullOrEmpty(after)) return false;
5011
+ return before !== after;
5012
+ }
5013
+
4640
5014
  // src/analyzer/replacement-rules/rules.ts
4641
5015
  function initializeRules() {
4642
5016
  this.rules.set("AWS::S3::Bucket", {
@@ -4977,11 +5351,23 @@ function initializeRules() {
4977
5351
  });
4978
5352
  this.rules.set("AWS::RDS::DBCluster", {
4979
5353
  replacementProperties: /* @__PURE__ */ new Set(),
4980
- conditionalReplacements: /* @__PURE__ */ new Map([["Engine", dbClusterEngineChangeReplaces]])
5354
+ conditionalReplacements: /* @__PURE__ */ new Map([["Engine", dbClusterEngineChangeReplaces], ["GlobalClusterIdentifier", dbClusterGlobalClusterChangeReplaces]])
4981
5355
  });
4982
5356
  this.rules.set("AWS::RDS::DBInstance", {
4983
5357
  replacementProperties: /* @__PURE__ */ new Set(),
4984
- conditionalReplacements: /* @__PURE__ */ new Map([["Engine", dbInstanceEngineChangeReplaces]])
5358
+ conditionalReplacements: /* @__PURE__ */ new Map([
5359
+ ["Engine", dbInstanceEngineChangeReplaces],
5360
+ ["AvailabilityZone", dbInstanceAvailabilityZoneChangeReplaces],
5361
+ ["PerformanceInsightsKMSKeyId", dbInstancePerformanceInsightsKmsKeyChangeReplaces],
5362
+ ["SourceDBInstanceIdentifier", dbInstanceReplicaSourceChangeReplaces],
5363
+ ["SourceDBClusterIdentifier", dbInstanceReplicaSourceChangeReplaces],
5364
+ ["DBSnapshotIdentifier", dbInstanceRestoreInputChangeReplaces],
5365
+ ["DBClusterSnapshotIdentifier", dbInstanceRestoreInputChangeReplaces],
5366
+ ["RestoreTime", dbInstanceRestoreInputChangeReplaces],
5367
+ ["SourceDBInstanceAutomatedBackupsArn", dbInstanceRestoreInputChangeReplaces],
5368
+ ["SourceDbiResourceId", dbInstanceRestoreInputChangeReplaces],
5369
+ ["UseLatestRestorableTime", dbInstanceUseLatestRestorableTimeChangeReplaces]
5370
+ ])
4985
5371
  });
4986
5372
  this.rules.set("AWS::EC2::Subnet", {
4987
5373
  replacementProperties: /* @__PURE__ */ new Set([
@@ -5004,7 +5390,6 @@ function initializeRules() {
5004
5390
  });
5005
5391
  this.rules.set("AWS::EC2::Instance", {
5006
5392
  replacementProperties: /* @__PURE__ */ new Set([
5007
- "EbsOptimized",
5008
5393
  "AvailabilityZone",
5009
5394
  "ImageId",
5010
5395
  "SubnetId",
@@ -5020,6 +5405,7 @@ function initializeRules() {
5020
5405
  "HostResourceGroupArn",
5021
5406
  "SecurityGroups"
5022
5407
  ]),
5408
+ updateableProperties: /* @__PURE__ */ new Set(["EbsOptimized"]),
5023
5409
  conditionalReplacements: /* @__PURE__ */ new Map([
5024
5410
  ["SecurityGroupIds", instanceSecurityGroupIdsChangeReplaces],
5025
5411
  ["BlockDeviceMappings", instanceBlockDeviceMappingsChangeReplaces],
@@ -5119,5 +5505,5 @@ var ReplacementRulesRegistry = class {
5119
5505
  }
5120
5506
  };
5121
5507
 
5122
- export { snapshotPassProvenance as $, inheritedRenderedToken as $t, witnessNormalize as A, recordFreshNoEchoValuesIn as An, withPhysicalNameCopies as At, redactionClaimOf as B, isSingleDynamicReferenceToken as Bn, pathCrossesDottedKey as Bt, passedNoEchoParametersOf as C, isScopedSecretVerdict as Cn, replaceWholeLeaves as Ct, recordedNoEchoValuesOf as D, pinScopedSecretVerdict as Dn, repairPhysicalNameCopyLeaves as Dt, recordPassedNoEchoParameters as E, noEchoParameterPlaintextsOf as En, repairEmbeddedPhysicalNamesTowards as Et, markLeafCertifiedBag as F, recordProvenPublicExpression as Fn, dynamicReferenceTokens as Ft, foldRecording as G, standsForInheritedSecret as Gt, mixedLiteralAnswered as H, identityKeyFor as Ht, markSameGenerationBag as I, wholeStringLeavesOf as In, isUncertifiedBaselineMaskPosition as It, hasPassProvenance as J, inheritedPseudoValue as Jt, openRecordingScope as K, recordDroppedArrayElements as Kt, mergeResolvedPairs as L, withoutNoEchoParameterEntries as Ln, keepTemplateLiteralLeaves as Lt, carryRedactionMarks as M, recordMaskOnlyValuesIn as Mn, spanNamesResolvableService as Mt, intrinsicLeafResolutionOf as N, recordNoEchoAttributeValues as Nn, DYNAMIC_REFERENCE_TOKEN_SCAN as Nt, replaceAtCoordinates as O, provenPublicValue as On, replaceEmbeddedPhysicalNameRewrites as Ot, isSameGenerationBag as P, recordNoEchoParameterFreshValue as Pn, dynamicReferenceSpans as Pt, recordReferenceResolution as Q, inheritedParameterExpression as Qt, recordIntrinsicLeafResolution as R, WHOLE_DYNAMIC_REFERENCE_PATTERN as Rn, secretRerenderPairs as Rt, noEchoParametersReadBy as S, isNoEchoParameterPlaintext as Sn, overlapRuleAnswered as St, readsNoEchoSource as T, markNoEchoParameterClass as Tn, embeddedPhysicalNameRewrites as Tt, withLegacyMixedScan as U, rereadParameterExpression as Ut, resolvedPlaintextOf as V, maskMatchSpans as Vn, arrayPairsWhateverDrops as Vt, redactForState as W, splitOutsideDynamicReferences as Wt, passReadVersionsFor as X, templateRereadsAccountId as Xt, passProvenanceFor as Y, recordInheritedPseudoParameters as Yt, recordReferenceProvenanceEntry as Z, inheritNestedStackParameterAssociations as Zt, noEchoComparison as _, carriesSecretMask as _n, maskSecretsInError as _t, emrClusterInstancesReplaced as a, embedsFreshNoEchoValue as an, literalSplitDelimitersOf as at, noEchoOutputsComparison as b, freshNoEchoValuesOf as bn, legacyLeavesWithoutMask as bt, parseLambdaFunctionAddress as c, recoverMaskedOutput as cn, printingCorpusOf as ct, canonicalJson as d, recordPhysicalNameCopy as dn, recordLogOnlyValue as dt, recordInheritedParameterRead as en, carryLogOnlyValues as et, isMarkedCoordinate as f, recordNestedStackParameterExpressions as fn, shareLogOnlyValues as ft, maskedLeafCoordinatesOf as g, splitGetAttStringForm as gn, maskRecordedSecretsInText as gt, maskWholeValue as h, recordCrossStackExpression as hn, errorCauseChain as ht, ecsServiceLaunchTypeSetOrChanged as i, carriesFreshNoEchoValue as in, hasMaskableValues as it, liveMatchesUnresolvedTokenFrame as j, recordMaskOnlyValue as jn, withoutPhysicalNameCopies as jt, valueAtCoordinate as k, recordDerivedMaskOnlyValue as kn, scrubResourceRecord as kt, sameLambdaFunctionAddress as l, physicalNameCopiesOf as ln, recordLogOnlyParameterValue as lt, maskReadbackAtCoordinates as m, crossStackSourceKey as mn, createSecretMasker as mt, blockDeviceMappingsDifferOnlyInDeleteOnTermination as n, redactInheritedParameterValue as nn, createUnionSecretMasker as nt, canonicalLambdaFunctionName as o, freshNoEchoLeafPositions as on, logOnlyValueCount as ot, maskAtCoordinates as p, nestedStackRowTagSpellingOf as pn, unionOfSecretBags as pt, recordSecretResolution as q, recordTakenIfBranch as qt, dbInstanceEngineChangeIsInPlace as r, withdrawRenderedParameterSpelling as rn, hasLogOnlyValues as rt, lambdaFunctionNameForMask as s, recordRecoverableMaskedOutput as sn, logOnlyValuesOf as st, ReplacementRulesRegistry as t, recordInheritedParameterValue as tn, carryLogOnlyValuesCarriedBy as tt, canonicalCoordinates as u, recordAttributeIdCopy as un, recordLogOnlySplitFragments as ut, noEchoCoordinatesOf as v, carryFreshNoEchoMark as vn, maskSecretsInText as vt, readbackPathFor as w, isSecretExpressionByVerdictOrSpelling as wn, withLegacyOverlapScan as wt, noEchoParameterNodesAt as x, isMaskOnlyPlaintext as xn, legacyReferenceLeavesOnly as xt, noEchoLeavesOf as y, contradictProvenPublicExpression as yn, differingStringLeaves as yt, recordIntrinsicLeafResolutionAs as z, isDynamicReferenceString as zn, spelledKeysOf as zt };
5123
- //# sourceMappingURL=replacement-rules-BYsfga8b.js.map
5508
+ export { snapshotPassProvenance as $, inheritedParameterExpression as $t, witnessNormalize as A, recordDerivedMaskOnlyValue as An, withPhysicalNameCopies as At, redactionClaimOf as B, isDynamicReferenceString as Bn, spelledKeysOf as Bt, passedNoEchoParametersOf as C, isNoEchoParameterPlaintext as Cn, replaceWholeLeaves as Ct, recordedNoEchoValuesOf as D, noEchoParameterPlaintextsOf as Dn, repairPhysicalNameCopyLeaves as Dt, recordPassedNoEchoParameters as E, markNoEchoParameterClass as En, repairEmbeddedPhysicalNamesTowards as Et, markLeafCertifiedBag as F, recordNoEchoParameterFreshValue as Fn, DYNAMIC_REFERENCE_TOKEN_SCAN as Ft, foldRecording as G, splitOutsideDynamicReferences as Gt, mixedLiteralAnswered as H, maskMatchSpans as Hn, arrayPairsWhateverDrops as Ht, markSameGenerationBag as I, recordProvenPublicExpression as In, dynamicReferenceSpans as It, hasPassProvenance as J, recordTakenIfBranch as Jt, openRecordingScope as K, standsForInheritedSecret as Kt, mergeResolvedPairs as L, wholeStringLeavesOf as Ln, dynamicReferenceTokens as Lt, carryRedactionMarks as M, recordMaskOnlyValue as Mn, spanNamesResolvableService as Mt, intrinsicLeafResolutionOf as N, recordMaskOnlyValuesIn as Nn, isUncertifiedBaselineMaskPosition as Nt, replaceAtCoordinates as O, pinScopedSecretVerdict as On, replaceEmbeddedPhysicalNameRewrites as Ot, isSameGenerationBag as P, recordNoEchoAttributeValues as Pn, staticTemplateText as Pt, recordReferenceResolution as Q, inheritNestedStackParameterAssociations as Qt, recordIntrinsicLeafResolution as R, withoutNoEchoParameterEntries as Rn, keepTemplateLiteralLeaves as Rt, noEchoParametersReadBy as S, isMaskOnlyPlaintext as Sn, overlapRuleAnswered as St, readsNoEchoSource as T, isSecretExpressionByVerdictOrSpelling as Tn, embeddedPhysicalNameRewrites as Tt, withLegacyMixedScan as U, identityKeyFor as Ut, resolvedPlaintextOf as V, isSingleDynamicReferenceToken as Vn, pathCrossesDottedKey as Vt, redactForState as W, rereadParameterExpression as Wt, passReadVersionsFor as X, recordInheritedPseudoParameters as Xt, passProvenanceFor as Y, inheritedPseudoValue as Yt, recordReferenceProvenanceEntry as Z, templateRereadsAccountId as Zt, noEchoComparison as _, splitGetAttStringForm as _n, maskSecretsInError as _t, emrClusterInstancesReplaced as a, carriesFreshNoEchoValue as an, literalSplitDelimitersOf as at, noEchoOutputsComparison as b, contradictProvenPublicExpression as bn, legacyLeavesWithoutMask as bt, parseLambdaFunctionAddress as c, recordRecoverableMaskedOutput as cn, printingCorpusOf as ct, canonicalJson as d, recordAttributeIdCopy as dn, recordLogOnlyValue as dt, inheritedRenderedToken as en, carryLogOnlyValues as et, isMarkedCoordinate as f, recordPhysicalNameCopy as fn, shareLogOnlyValues as ft, maskedLeafCoordinatesOf as g, recordCrossStackExpression as gn, maskRecordedSecretsInText as gt, maskWholeValue as h, crossStackSourceKey as hn, errorCauseChain as ht, ecsServiceLaunchTypeSetOrChanged as i, withdrawRenderedParameterSpelling as in, hasMaskableValues as it, liveMatchesUnresolvedTokenFrame as j, recordFreshNoEchoValuesIn as jn, withoutPhysicalNameCopies as jt, valueAtCoordinate as k, provenPublicValue as kn, scrubResourceRecord as kt, sameLambdaFunctionAddress as l, recoverMaskedOutput as ln, recordLogOnlyParameterValue as lt, maskReadbackAtCoordinates as m, nestedStackRowTagSpellingOf as mn, createSecretMasker as mt, blockDeviceMappingsDifferOnlyInDeleteOnTermination as n, recordInheritedParameterValue as nn, createUnionSecretMasker as nt, canonicalLambdaFunctionName as o, embedsFreshNoEchoValue as on, logOnlyValueCount as ot, maskAtCoordinates as p, recordNestedStackParameterExpressions as pn, unionOfSecretBags as pt, recordSecretResolution as q, recordDroppedArrayElements as qt, dbInstanceEngineChangeIsInPlace as r, redactInheritedParameterValue as rn, hasLogOnlyValues as rt, lambdaFunctionNameForMask as s, freshNoEchoLeafPositions as sn, logOnlyValuesOf as st, ReplacementRulesRegistry as t, recordInheritedParameterRead as tn, carryLogOnlyValuesCarriedBy as tt, canonicalCoordinates as u, physicalNameCopiesOf as un, recordLogOnlySplitFragments as ut, noEchoCoordinatesOf as v, carriesSecretMask as vn, maskSecretsInText as vt, readbackPathFor as w, isScopedSecretVerdict as wn, withLegacyOverlapScan as wt, noEchoParameterNodesAt as x, freshNoEchoValuesOf as xn, legacyReferenceLeavesOnly as xt, noEchoLeavesOf as y, carryFreshNoEchoMark as yn, differingStringLeaves as yt, recordIntrinsicLeafResolutionAs as z, WHOLE_DYNAMIC_REFERENCE_PATTERN as zn, secretRerenderPairs as zt };
5509
+ //# sourceMappingURL=replacement-rules-DL9MZWSp.js.map