1 | import * as lambda from '@aws-cdk/aws-lambda';
|
2 | import { IntegrationConfig, IntegrationOptions } from '../integration';
|
3 | import { Method } from '../method';
|
4 | import { AwsIntegration } from './aws';
|
5 | export interface LambdaIntegrationOptions extends IntegrationOptions {
|
6 | /**
|
7 | * Use proxy integration or normal (request/response mapping) integration.
|
8 | * @see https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format
|
9 | *
|
10 | * @default true
|
11 | */
|
12 | readonly proxy?: boolean;
|
13 | /**
|
14 | * Allow invoking method from AWS Console UI (for testing purposes).
|
15 | *
|
16 | * This will add another permission to the AWS Lambda resource policy which
|
17 | * will allow the `test-invoke-stage` stage to invoke this handler. If this
|
18 | * is set to `false`, the function will only be usable from the deployment
|
19 | * endpoint.
|
20 | *
|
21 | * @default true
|
22 | */
|
23 | readonly allowTestInvoke?: boolean;
|
24 | }
|
25 | /**
|
26 | * Integrates an AWS Lambda function to an API Gateway method.
|
27 | *
|
28 | * @example
|
29 | *
|
30 | * declare const resource: apigateway.Resource;
|
31 | * declare const handler: lambda.Function;
|
32 | * resource.addMethod('GET', new apigateway.LambdaIntegration(handler));
|
33 | *
|
34 | */
|
35 | export declare class LambdaIntegration extends AwsIntegration {
|
36 | private readonly handler;
|
37 | private readonly enableTest;
|
38 | constructor(handler: lambda.IFunction, options?: LambdaIntegrationOptions);
|
39 | bind(method: Method): IntegrationConfig;
|
40 | }
|