sparse-intern-71089
02/16/2021, 7:25 PMgentle-monitor-55086
02/16/2021, 7:26 PMimport * as awsx from "@pulumi/awsx";
export async function pingHandler(
event: awsx.apigateway.Request): Promise<awsx.apigateway.Response> {
return {
statusCode: 200,
body: "Hello, API Gateway!",
};
}
Currently i'm only exporting this route, but i was exporting two of them.
And my index.js is here
import * as awsx from "@pulumi/awsx";
import * as routes from "./api/routes/testing_routes";
const api = new awsx.apigateway.API("problematic", {
routes: [
{ path: "/ping", method: "GET", eventHandler: routes.pingHandler }
],
})
export const apiUrl = api.url;
So everything seems fine but i get 500's on the gateway call.
What's interesting is i did an initial deployment that was basically the "Creating a serverless REST API" from this page https://www.pulumi.com/serverless/ and everything worked fine.
Then i tried sliding in this /ping
route and moving that examples counter route to be at /counter/{route+}
That's when the 500's started, so i actually destroyed the deployment, changed the api name as well, and regressed to just the ping route.
The issue that's happening is all the roles and everything are being created, gateway is staging, deploying, etc. etc.
But if i test the route from Resources tab on api-gateway it says there's a permission error.
I have to go in to the /ping - GET - integration request
settings and where the lambda function is set, just click in, and then click the checkmark.
That makes the route able to invoke the lambda even though its the exact same name.gentle-monitor-55086
02/16/2021, 8:07 PMgentle-monitor-55086
02/16/2021, 8:22 PM