cdk-real-drift 0.12.45 → 0.12.46
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 +24 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9149,6 +9149,17 @@ function sha256Hex(bytes) {
|
|
|
9149
9149
|
|
|
9150
9150
|
//#endregion
|
|
9151
9151
|
//#region src/read/overrides.ts
|
|
9152
|
+
const OVERRIDE_READ_GAP = Symbol.for("cdkrd.overrideReadGap");
|
|
9153
|
+
function overrideReadGap(model, readGapPaths) {
|
|
9154
|
+
return {
|
|
9155
|
+
[OVERRIDE_READ_GAP]: true,
|
|
9156
|
+
model,
|
|
9157
|
+
readGapPaths
|
|
9158
|
+
};
|
|
9159
|
+
}
|
|
9160
|
+
function isOverrideReadResult(x) {
|
|
9161
|
+
return typeof x === "object" && x !== null && x[OVERRIDE_READ_GAP] === true;
|
|
9162
|
+
}
|
|
9152
9163
|
const str$1 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
9153
9164
|
const firstStr = (v) => Array.isArray(v) ? str$1(v[0]) : str$1(v);
|
|
9154
9165
|
function parsePolicy(s) {
|
|
@@ -10659,12 +10670,13 @@ const readCognitoIdentityPool = async ({ physicalId, declared, region }) => {
|
|
|
10659
10670
|
}).send(new GetCognitoEventsCommand({ IdentityPoolId: id }));
|
|
10660
10671
|
if (ev.Events && Object.keys(ev.Events).length > 0) model.CognitoEvents = ev.Events;
|
|
10661
10672
|
} 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`);
|
|
10673
|
+
if (isCognitoSyncRegionUnavailable(e)) {
|
|
10674
|
+
if ("CognitoEvents" in declared && !("CognitoEvents" in model)) model.CognitoEvents = declared.CognitoEvents;
|
|
10675
|
+
return model;
|
|
10667
10676
|
}
|
|
10677
|
+
const call = e?.name || "unknown error";
|
|
10678
|
+
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`);
|
|
10679
|
+
return overrideReadGap(model, ["CognitoEvents"]);
|
|
10668
10680
|
}
|
|
10669
10681
|
return model;
|
|
10670
10682
|
};
|
|
@@ -11752,13 +11764,18 @@ async function readLive(cc, resource, region, accountId) {
|
|
|
11752
11764
|
if (resourceType.startsWith("Custom::") || resourceType === "AWS::CloudFormation::CustomResource") return { skippedReason: "custom resource — no cloud-side model to read" };
|
|
11753
11765
|
const override = SDK_OVERRIDES[resourceType];
|
|
11754
11766
|
if (override) try {
|
|
11755
|
-
const
|
|
11767
|
+
const result = await override({
|
|
11756
11768
|
physicalId: physicalId ?? "",
|
|
11757
11769
|
declared,
|
|
11758
11770
|
region,
|
|
11759
11771
|
accountId
|
|
11760
11772
|
});
|
|
11761
|
-
|
|
11773
|
+
if (result === void 0) return { skippedReason: "SDK override: target not resolvable from template" };
|
|
11774
|
+
if (isOverrideReadResult(result)) return {
|
|
11775
|
+
live: result.model,
|
|
11776
|
+
readGapPaths: result.readGapPaths
|
|
11777
|
+
};
|
|
11778
|
+
return { live: result };
|
|
11762
11779
|
} catch (e) {
|
|
11763
11780
|
if (isResourceNotFoundError(e)) return { deleted: true };
|
|
11764
11781
|
return { skippedReason: `SDK override (${resourceType}): ${e.name}` };
|