sparse-continent-75335
02/20/2023, 7:24 PMimport * as aws from "@pulumi/aws";
import * as apigateway from "@pulumi/aws-apigateway";
// Create a Lambda Function
const helloHandler = new aws.lambda.CallbackFunction("hello-handler", {
callback: async (ev, ctx) => {
return {
statusCode: 200,
body: "Hello, API Gateway!",
};
},
});
// Define an endpoint that invokes a lambda to handle requests
const api = new apigateway.RestAPI("api", {
routes: [
{
path: "/",
method: "GET",
eventHandler: helloHandler,
},
],
});
export const url = api.url;
The first error I usually get is around needing an ARN (I think because it wants to run on behalf of a user), so try adding apiKeyRequired: false
to the route
Unable to put integration on 'GET' for resource at path '/': Invalid ARN specified in the request
(edited)