UNPKG

1.09 kBTypeScriptView Raw
1import { Handler } from "../handler";
2
3export type IoTHandler = Handler<IoTEvent, void>;
4
5// IoT
6// https://docs.aws.amazon.com/lambda/latest/dg/services-iot.html
7// IoT payload is not restriced to JSON, but JSON is highly recommended. Types as string, number or array are possible to use.
8
9export type IoTEvent<T = never> = string | number | T;
10
11// PreProvisioningHook
12// https://docs.aws.amazon.com/iot/latest/developerguide/pre-provisioning-hook.html
13// When using AWS IoT fleet provisioning, you can set up a Lambda function to validate parameters passed from the device before allowing the device to be provisioned.
14export type IoTPreProvisioningHookHandler = Handler<IoTPreProvisioningHookEvent, IoTPreProvisioningHookResult>;
15
16export interface IoTPreProvisioningHookEvent {
17 claimCertificateId: string;
18 certificateId: string;
19 certificatePem: string;
20 templateArn: string;
21 clientId: string;
22 parameters: Record<string, string>;
23}
24
25export interface IoTPreProvisioningHookResult {
26 allowProvisioning: boolean;
27 parameterOverrides: Record<string, string>;
28}