From fb0be67ad8462a883423e86bb839520f17885b55 Mon Sep 17 00:00:00 2001 From: Christian Nunciato Date: Fri, 19 Dec 2025 17:20:24 -0800 Subject: [PATCH 1/2] Fix apigateway.RestAPI eventHandler reference --- content/docs/iac/clouds/aws/guides/lambda.md | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/content/docs/iac/clouds/aws/guides/lambda.md b/content/docs/iac/clouds/aws/guides/lambda.md index 6625defb76a7..bfab345af109 100644 --- a/content/docs/iac/clouds/aws/guides/lambda.md +++ b/content/docs/iac/clouds/aws/guides/lambda.md @@ -338,6 +338,7 @@ Context objects are supplied to all Lambda functions and are typed as Lambda [`C To use these types, you can apply them as type annotations to your callback arguments. Here, for example, the `APIGatewayProxyEvent` and `Context` types are applied to the arguments of an inline AWS API Gateway route handler: ```typescript +import * as aws from "@pulumi/aws"; import * as apigateway from "@pulumi/aws-apigateway"; import { APIGatewayProxyEvent, Context } from "aws-lambda"; @@ -345,15 +346,18 @@ const api = new apigateway.RestAPI("api", { routes: [ { path: "/api", - eventHandler: async (event: APIGatewayProxyEvent, context: Context) => { - return { - statusCode: 200, - body: JSON.stringify({ - eventPath: event.path, - functionName: context.functionName, - }) - }; - }, + method: "GET", + eventHandler: new aws.lambda.CallbackFunction("handler", { + callback: async (event: APIGatewayProxyEvent, context: Context) => { + return { + statusCode: 200, + body: JSON.stringify({ + eventPath: event.path, + functionName: context.functionName, + }) + }; + }, + }), }, ], }); From 335e636268f9e22257242d0c419ca3ee61b08613 Mon Sep 17 00:00:00 2001 From: Christian Nunciato Date: Fri, 19 Dec 2025 17:27:48 -0800 Subject: [PATCH 2/2] Your trailing comma, sir. --- content/docs/iac/clouds/aws/guides/lambda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/iac/clouds/aws/guides/lambda.md b/content/docs/iac/clouds/aws/guides/lambda.md index bfab345af109..29671bce1fb4 100644 --- a/content/docs/iac/clouds/aws/guides/lambda.md +++ b/content/docs/iac/clouds/aws/guides/lambda.md @@ -354,7 +354,7 @@ const api = new apigateway.RestAPI("api", { body: JSON.stringify({ eventPath: event.path, functionName: context.functionName, - }) + }), }; }, }),