Skip to main content

Function

Provides an Lambda Function

Examples#

Create a Lambda Function#

const lambdaPolicy = require("./lambdaPolicy.json");
const lambdaAssumePolicy = require("./lambdaAssumePolicy.json");
const iamPolicy = provider.IAM.makePolicy({
name: "lambda-policy",
properties: () => lambdaPolicy,
});
const iamRole = provider.IAM.makeRole({
name: "lambda-role",
dependencies: { policies: [iamPolicy] },
properties: () => lambdaAssumePolicy,
});
const lambda = provider.Lambda.makeFunction({
name: "lambda-hello-world", // Source must be located in the direcory 'lambda-hello-world'
dependencies: { role: iamRole },
properties: () => ({
PackageType: "Zip",
Handler: "helloworld.handler", // The handler function must de defined in lambda-hello-world/helloworkd.js
Runtime: "nodejs14.x",
}),
});

Source Code Examples#

Properties#

Dependencies#

UsedBy#

List#

The list of functions can be displayed and filtered with the type Function:

gc list -t Function