Module serverless

@pulumi/aws > serverless

class Function

extends ComponentResource

Function is a higher-level API for creating and managing AWS Lambda Function resources implemented by a Pulumi lambda expression and with a set of attached policies.


new Function(name: string, options: FunctionOptions, func?: Handler, opts?: pulumi.ResourceOptions)
  • func Deprecated. Pass the function as [options.func] or [options.factoryFunc] instead.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

method registerOutputs

protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): void

property lambda

public lambda: lambda.Function;

property options

public options: FunctionOptions;

property role

public role: Role | undefined;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

type Context

type Context = lambda.Context;

type FunctionOptions

type FunctionOptions = utils.Overwrite<lambda.CallbackFunctionArgs<any, any>, {
    excludePackages: string[];
    factoryFunc: HandlerFactory;
    func: Handler;
    includePackages: string[];
    includePaths: string[];

FunctionOptions provides configuration options for the serverless Function. It is effectively equivalent to [aws.lambda.FunctionArgs] except with a few important differences documented at the property level. For example, [role] is an actual iam.Role instance, and not an ARN. Properties like [runtime] are now optional. And some properties (like [code]) are entirely disallowed.

type Handler

type Handler = lambda.Callback<any, any>;

[Handler] is the signature for a serverless function that will be invoked each time the AWS Lambda is invoked.

type HandlerFactory

type HandlerFactory = () => Handler;

HandlerFactory is the signature for a function that will be called once to produce the serverless function that AWS Lambda will invoke. It can be used to initialize expensive state once that can then be used across all invocations of the Lambda (as long as the Lambda is using the same warm node instance).