event-invoke-config.d.ts
1 import { Duration, Resource } from '@aws-cdk/core'; 2 import { Construct } from 'constructs'; 3 import { IDestination } from './destination'; 4 import { IFunction } from './function-base'; 5 /** 6 * Options to add an EventInvokeConfig to a function. 7 * 8 * @stability stable 9 */ 10 export interface EventInvokeConfigOptions { 11 /** 12 * The destination for failed invocations. 13 * 14 * @default - no destination 15 * @stability stable 16 */ 17 readonly onFailure?: IDestination; 18 /** 19 * The destination for successful invocations. 20 * 21 * @default - no destination 22 * @stability stable 23 */ 24 readonly onSuccess?: IDestination; 25 /** 26 * The maximum age of a request that Lambda sends to a function for processing. 27 * 28 * Minimum: 60 seconds 29 * Maximum: 6 hours 30 * 31 * @default Duration.hours(6) 32 * @stability stable 33 */ 34 readonly maxEventAge?: Duration; 35 /** 36 * The maximum number of times to retry when the function returns an error. 37 * 38 * Minimum: 0 39 * Maximum: 2 40 * 41 * @default 2 42 * @stability stable 43 */ 44 readonly retryAttempts?: number; 45 } 46 /** 47 * Properties for an EventInvokeConfig. 48 * 49 * @stability stable 50 */ 51 export interface EventInvokeConfigProps extends EventInvokeConfigOptions { 52 /** 53 * The Lambda function. 54 * 55 * @stability stable 56 */ 57 readonly function: IFunction; 58 /** 59 * The qualifier. 60 * 61 * @default - latest version 62 * @stability stable 63 */ 64 readonly qualifier?: string; 65 } 66 /** 67 * Configure options for asynchronous invocation on a version or an alias. 68 * 69 * By default, Lambda retries an asynchronous invocation twice if the function 70 * returns an error. It retains events in a queue for up to six hours. When an 71 * event fails all processing attempts or stays in the asynchronous invocation 72 * queue for too long, Lambda discards it. 73 * 74 * @stability stable 75 */ 76 export declare class EventInvokeConfig extends Resource { 77 /** 78 * @stability stable 79 */ 80 constructor(scope: Construct, id: string, props: EventInvokeConfigProps); 81 }