Skip to content

Instantly share code, notes, and snippets.

@cnunciato
Created August 26, 2022 21:29
Show Gist options
  • Save cnunciato/a2d301482bebb37f2cdc6bb824c97ccd to your computer and use it in GitHub Desktop.
Save cnunciato/a2d301482bebb37f2cdc6bb824c97ccd to your computer and use it in GitHub Desktop.
import * as aws from "@pulumi/aws";
const lambda = new aws.lambda.CallbackFunction("my-function", {
callback: () => {
console.log("Hello, world!");
},
});
export const { id } = lambda;
// Creating a Lambda function in Pulumi
import * as aws from "@pulumi/aws";
lambdaFunction = new aws.lambda.Function(`${lambdaName}`, {
name: lambdaName,
role: lambdaRole.arn,
handler: "index.handler",
runtime: "nodejs16.x",
s3Bucket: codeBucket.id,
s3Key: lambdaCodeObject.key,
sourceCodeHash: lambdaZipHash,
}, {
dependsOn: [
lambdaRole,
cloudWatch,
],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment