UNPKG

@multicloud/sls-aws

Version:

Amazon AWS specific middleware and components for Serverless @multicloud.

37 lines (36 loc) 1.19 kB
import { CloudService, ContainerResolver, CloudServiceOptions, CloudContext } from "@multicloud/sls-core"; /** * Type of invocation for AWS Lambda */ export declare enum AWSInvokeType { /** Wait for response */ fireAndWait = "RequestResponse", /** Don't wait for response */ fireAndForget = "Event" } /** * Options for invocation of AWS Lambda */ export interface AWSCloudServiceOptions extends CloudServiceOptions { /** Name of Lambda function to invoke */ name: string; /** Unique resource identifier for Lambda function */ arn: string; /** AWS Region containing lambda function */ region: string; } /** * Implementation of Cloud Service for AWS Lambda. Invokes Lambda Functions * with exposed HTTP endpoints via API Gateway */ export declare class LambdaCloudService implements CloudService { constructor(context: CloudContext); containerResolver: ContainerResolver; /** * * @param name Name of Lambda function to invoke * @param fireAndForget Wait for response if false (default behavior) * @param payload Body of HTTP request */ invoke<T>(name: string, fireAndForget: boolean, payload: any): T; }