Skip to content

GetUsagePlanKey

Source: src/AWS/ApiGateway/GetUsagePlanKey.ts

Runtime binding for reading a single API key enrolled in a UsagePlan (apigateway:GET on /usageplans/{id}/keys/{keyId}).

Provide ApiGateway.GetUsagePlanKeyHttp on the Function effect to implement the binding.

// init
const getUsagePlanKey = yield* ApiGateway.GetUsagePlanKey(plan);
// runtime
const enrolled = yield* getUsagePlanKey({ keyId }).pipe(
Effect.map(() => true),
Effect.catchTag("NotFoundException", () => Effect.succeed(false)),
);