https://pulumi.com logo
Title
c

clever-soccer-98174

11/30/2022, 11:00 AM
👋🏻 Hey All 🙂 Another question regarding lambda + apigateway : I’m trying this crosswalk https://www.pulumi.com/docs/guides/crosswalk/aws/api-gateway/ I’m using the code as it is with exactly as it is :
import * 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;
But unfortunately I’m stucked with this error :
error: update failed

  aws:apigateway:RestApi (api):
    error: 1 error occurred:
        * creating urn:pulumi:dev::meeting-integrations::aws-apigateway:index:RestAPI$aws:apigateway/restApi:RestApi::api: 1 error occurred:
        * error creating API Gateway specification: BadRequestException: Errors found during import:
        Unable to put integration on 'GET' for resource at path '/': Invalid ARN specified in the request
Do you have any knowledge about this issue?
m

miniature-musician-31262

11/30/2022, 12:42 PM
Hi there — would you mind sharing the versions of the
@pulumi
packages in your package.json?
c

clever-soccer-98174

11/30/2022, 1:24 PM
Sure
"dependencies": {
        "@pulumi/aws": "^5.0.0",
        "@pulumi/awsx": "^0.40.0",
        "@pulumi/pulumi": "^3.0.0",
        "aws-sdk": "^2.1264.0"
    }
m

miniature-musician-31262

11/30/2022, 6:38 PM
Interesting — I don’t see
@pulumi/aws-apigateway
in that list (imported by your code), so I’m surprised you aren’t getting a straight-up compile error. 🤔