cdk-real-drift 0.4.37 → 0.4.38

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 CHANGED
@@ -8717,7 +8717,7 @@ const readAppSyncApiKey = async ({ physicalId, declared, region }) => {
8717
8717
  if (k.expires !== void 0) model.Expires = k.expires;
8718
8718
  return model;
8719
8719
  };
8720
- const readCognitoIdentityPool = async ({ physicalId, region }) => {
8720
+ const readCognitoIdentityPool = async ({ physicalId, declared, region }) => {
8721
8721
  const id = str$1(physicalId);
8722
8722
  if (!id) return void 0;
8723
8723
  const g = await new CloudControlClient({
@@ -8734,9 +8734,25 @@ const readCognitoIdentityPool = async ({ physicalId, region }) => {
8734
8734
  ...READ_RETRY
8735
8735
  }).send(new GetCognitoEventsCommand({ IdentityPoolId: id }));
8736
8736
  if (ev.Events && Object.keys(ev.Events).length > 0) model.CognitoEvents = ev.Events;
8737
- } catch {}
8737
+ } catch (e) {
8738
+ if ("CognitoEvents" in declared && !("CognitoEvents" in model)) model.CognitoEvents = declared.CognitoEvents;
8739
+ if (!isCognitoSyncRegionUnavailable(e)) {
8740
+ const call = e?.name || "unknown error";
8741
+ 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)" : "";
8742
+ process.stderr.write(`[cdkrd] warning: cognito-sync:GetCognitoEvents for ${id} failed (${call})${gap}\n`);
8743
+ }
8744
+ }
8738
8745
  return model;
8739
8746
  };
8747
+ function isCognitoSyncRegionUnavailable(err) {
8748
+ if (isDefinitiveDenial(err)) return false;
8749
+ const e = err;
8750
+ if (!e) return false;
8751
+ const regionUnavailable = /^(UnknownEndpoint|EndpointError|InvalidEndpoint)$/;
8752
+ if (e.name && regionUnavailable.test(e.name)) return true;
8753
+ if (e.code && (regionUnavailable.test(e.code) || e.code === "ENOTFOUND")) return true;
8754
+ return e.cause?.code === "ENOTFOUND" || e.cause?.errno === "ENOTFOUND";
8755
+ }
8740
8756
  const readSesReceiptRuleSet = async ({ physicalId, declared, region }) => {
8741
8757
  const name = str$1(physicalId) ?? str$1(declared.RuleSetName);
8742
8758
  if (!name) return void 0;