Skip to content

GetListElements

Source: src/AWS/FraudDetector/GetListElements.ts

Read the elements of a bound Amazon Fraud Detector list — the effectful lookup call made from a deployed Lambda or Task, e.g. to check an incoming value against a deny-list outside of a detector evaluation.

Elements decode as sensitive values (string | Redacted<string>); unwrap with Redacted.value where needed.

Provide the GetListElementsHttp implementation layer on the Function effect, bind the list in the init phase, then call the returned client at runtime. The binding grants frauddetector:GetListElements on the list and injects its name automatically.

// init
const getListElements = yield* FraudDetector.GetListElements(blockedIps);
return {
fetch: Effect.gen(function* () {
// runtime
const { elements } = yield* getListElements({});
return HttpServerResponse.json({ count: elements?.length ?? 0 });
}),
};
// on the Function effect:
// .pipe(Effect.provide(FraudDetector.GetListElementsHttp))