cdk-real-drift 0.12.45 → 0.12.47
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/cli.js +34 -10
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1359,8 +1359,14 @@ const CONTAINS_DYNAMIC_REFERENCE_RE = /\{\{resolve:(ssm|ssm-secure|secretsmanage
|
|
|
1359
1359
|
function containsDynamicReference(v) {
|
|
1360
1360
|
return CONTAINS_DYNAMIC_REFERENCE_RE.test(v);
|
|
1361
1361
|
}
|
|
1362
|
+
function containsDynamicReferenceDeep(v) {
|
|
1363
|
+
if (typeof v === "string") return containsDynamicReference(v);
|
|
1364
|
+
if (Array.isArray(v)) return v.some(containsDynamicReferenceDeep);
|
|
1365
|
+
if (v !== null && typeof v === "object") return Object.values(v).some(containsDynamicReferenceDeep);
|
|
1366
|
+
return false;
|
|
1367
|
+
}
|
|
1362
1368
|
function checkResolvedDynamicRef(r) {
|
|
1363
|
-
return
|
|
1369
|
+
return containsDynamicReferenceDeep(r) ? UNRESOLVED : r;
|
|
1364
1370
|
}
|
|
1365
1371
|
function isScalarInterpolant(v) {
|
|
1366
1372
|
const t = typeof v;
|
|
@@ -1406,11 +1412,12 @@ function resolve$1(node, ctx, inCondition = false) {
|
|
|
1406
1412
|
const [idxRaw, list] = v;
|
|
1407
1413
|
const arr = resolve$1(list, ctx);
|
|
1408
1414
|
if (!Array.isArray(arr)) return UNRESOLVED;
|
|
1415
|
+
const compacted = arr.filter((x) => x !== NOVALUE);
|
|
1409
1416
|
const idx = resolve$1(idxRaw, ctx);
|
|
1410
1417
|
if (idx === UNRESOLVED) return UNRESOLVED;
|
|
1411
1418
|
const i = Number(idx);
|
|
1412
|
-
if (!Number.isInteger(i) || i < 0 || i >=
|
|
1413
|
-
const sel =
|
|
1419
|
+
if (!Number.isInteger(i) || i < 0 || i >= compacted.length) return UNRESOLVED;
|
|
1420
|
+
const sel = compacted[i];
|
|
1414
1421
|
return sel === UNRESOLVED ? UNRESOLVED : checkResolvedDynamicRef(sel);
|
|
1415
1422
|
}
|
|
1416
1423
|
case "Fn::FindInMap": {
|
|
@@ -9149,6 +9156,17 @@ function sha256Hex(bytes) {
|
|
|
9149
9156
|
|
|
9150
9157
|
//#endregion
|
|
9151
9158
|
//#region src/read/overrides.ts
|
|
9159
|
+
const OVERRIDE_READ_GAP = Symbol.for("cdkrd.overrideReadGap");
|
|
9160
|
+
function overrideReadGap(model, readGapPaths) {
|
|
9161
|
+
return {
|
|
9162
|
+
[OVERRIDE_READ_GAP]: true,
|
|
9163
|
+
model,
|
|
9164
|
+
readGapPaths
|
|
9165
|
+
};
|
|
9166
|
+
}
|
|
9167
|
+
function isOverrideReadResult(x) {
|
|
9168
|
+
return typeof x === "object" && x !== null && x[OVERRIDE_READ_GAP] === true;
|
|
9169
|
+
}
|
|
9152
9170
|
const str$1 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
9153
9171
|
const firstStr = (v) => Array.isArray(v) ? str$1(v[0]) : str$1(v);
|
|
9154
9172
|
function parsePolicy(s) {
|
|
@@ -10659,12 +10677,13 @@ const readCognitoIdentityPool = async ({ physicalId, declared, region }) => {
|
|
|
10659
10677
|
}).send(new GetCognitoEventsCommand({ IdentityPoolId: id }));
|
|
10660
10678
|
if (ev.Events && Object.keys(ev.Events).length > 0) model.CognitoEvents = ev.Events;
|
|
10661
10679
|
} catch (e) {
|
|
10662
|
-
if (
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
const gap = "CognitoEvents" in declared ? " — treating CognitoEvents as an unverifiable read-gap (declared value assumed unchanged; grant cognito-sync:GetCognitoEvents to detect out-of-band drift on it)" : "";
|
|
10666
|
-
process.stderr.write(`[cdkrd] warning: cognito-sync:GetCognitoEvents for ${id} failed (${call})${gap}\n`);
|
|
10680
|
+
if (isCognitoSyncRegionUnavailable(e)) {
|
|
10681
|
+
if ("CognitoEvents" in declared && !("CognitoEvents" in model)) model.CognitoEvents = declared.CognitoEvents;
|
|
10682
|
+
return model;
|
|
10667
10683
|
}
|
|
10684
|
+
const call = e?.name || "unknown error";
|
|
10685
|
+
process.stderr.write(`[cdkrd] warning: cognito-sync:GetCognitoEvents for ${id} failed (${call}) — treating CognitoEvents as an unverifiable read-gap (grant cognito-sync:GetCognitoEvents to detect out-of-band drift on it)\n`);
|
|
10686
|
+
return overrideReadGap(model, ["CognitoEvents"]);
|
|
10668
10687
|
}
|
|
10669
10688
|
return model;
|
|
10670
10689
|
};
|
|
@@ -11752,13 +11771,18 @@ async function readLive(cc, resource, region, accountId) {
|
|
|
11752
11771
|
if (resourceType.startsWith("Custom::") || resourceType === "AWS::CloudFormation::CustomResource") return { skippedReason: "custom resource — no cloud-side model to read" };
|
|
11753
11772
|
const override = SDK_OVERRIDES[resourceType];
|
|
11754
11773
|
if (override) try {
|
|
11755
|
-
const
|
|
11774
|
+
const result = await override({
|
|
11756
11775
|
physicalId: physicalId ?? "",
|
|
11757
11776
|
declared,
|
|
11758
11777
|
region,
|
|
11759
11778
|
accountId
|
|
11760
11779
|
});
|
|
11761
|
-
|
|
11780
|
+
if (result === void 0) return { skippedReason: "SDK override: target not resolvable from template" };
|
|
11781
|
+
if (isOverrideReadResult(result)) return {
|
|
11782
|
+
live: result.model,
|
|
11783
|
+
readGapPaths: result.readGapPaths
|
|
11784
|
+
};
|
|
11785
|
+
return { live: result };
|
|
11762
11786
|
} catch (e) {
|
|
11763
11787
|
if (isResourceNotFoundError(e)) return { deleted: true };
|
|
11764
11788
|
return { skippedReason: `SDK override (${resourceType}): ${e.name}` };
|