This message was deleted.
# general
s
This message was deleted.
b
you can see it's erroring at
at /data/pulumi/node_modules/read-package-tree/rpt.js:162:20
so it does seem to be finding/running the pulumi code from further up
creating a symlink to the package.json further up in the local directory seems to be working but i'm getting all kinds of warnings about dependencies
l
Is this happening when serializing functions for lambda Azure functions or similar? There's a.. feature deficiency?... in that area. It should work in all projects that have no function serialization, I think.
b
no, i was just trying to use AWSX most basic example for apigateway
was a standalone index.ts file in a folder, normal setup just doing a
pulumi up
on it
Copy code
import * as awsx from "@pulumi/awsx";

// Define a new GET endpoint that just returns a 200 and "hello" in the body.
const api = new awsx.apigateway.API("example", {
    routes: [{
        path: "/",
        method: "GET",
        eventHandler: async (event) => {
            // This code runs in an AWS Lambda anytime `/` is hit.
            return {
                statusCode: 200,
                body: "Hello, API Gateway!",
            };
        },
    }],
})
basically just this ^ i needed a simple public endpoint, but then i see it doesn't handle CORS so I just went back and used some other code I had with all the OPTIONS/MOCK stuff in it
l
Yes, so there's function serialization there.
The eventHandler is bundled up during the Pulumi
up
in order to be sent to AWS.
There is a known issue with this. Pulumi assumes that the current directory is the one with package.json, node_modules, etc.
So if that code isn't in your top-level directory, you need symlinks to make it work, for now.
b
ok thanks for reply, for now i'm past it, but good to know