pulumi-awsx
pulumi-awsx copied to clipboard
Simplify deploying Python and TypeScript lambdas with dependencies
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Consider simplifying deploying lambda function code with dependencies as this is non-trivial for beginners.
An existing solution in this space is the lambda-builders library. It has CLI with a JSON-RPC interface. Scope of this library: “given a folder containing function's source code, the selected build action, and path to an artifacts folder, this library will produce built artifacts in the artifacts folder.”
Possibly Pulumi could integrate with it directly to provide a component library where you could write:
const testLambda = new aws.lambda.Function("test_lambda", {
code: new lambda_builders.Nodejs("../path/to/package.json"), // uses lambda-builders
name: "lambda_function_name",
role: iamForLambda.arn,
handler: "index.test",
runtime: "nodejs18.x",
});
Affected area/feature
One interesting user story: https://levelup.gitconnected.com/my-journey-with-pulumi-and-the-serverless-framework-2b1398ee581a - there might be additional complications for CallbackFunction coming from closure serialization, but even if those were not fully addressed if we could guide users to a reasonable way to refactor CallbackFunctions into normal functions that could be helpful here.