Module serverless

This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

Resources

Others

Resources

Resource Function

DEPRECATED Use [lambda.CallbackFunction] instead.
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.

constructor

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

method getData

protected getData(): Promise<TData>

Retrieves the data produces by [initialize]. The data is immediately available in a derived class’s constructor after the super(...) call to ComponentResource.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method initialize

protected initialize(args: Inputs): Promise<TData>

Can be overridden by a subclass to asynchronously initialize data for this Component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use .getData.

method isInstance

static isInstance(obj: any): obj is ComponentResource

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

registerOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

ComponentResources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

property lambda

public 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.

Others

type Context

DEPRECATED Use [aws.lambda.Context] instead.
type Context = Context;

type FunctionOptions

DEPRECATED Use [aws.lambda.FunctionOptions] instead.
type FunctionOptions = utils.Overwrite<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

DEPRECATED Use [aws.lambda.Callback] instead.
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

DEPRECATED Use [aws.lambda.CallbackFactory] instead.
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).