AwsLambda

AWS Lambda service component.

Remarks

Naming:

  • Type ${namespace}:aws:AwsLambda; function roots use capability lambda and the shared identity args.function.functionName, producing ${env}-${projectHash}-lambda-${sanitised args.function.functionName}.
  • Layer roots use capability lambda-layer and the shared identity args.layer.name, producing ${env}-${projectHash}-lambda-layer-${sanitised args.layer.name}. Layer-version children use [args.layer.name] beneath this exported parent.
  • Both provider names use stackAndPurpose: ${env}-${projectHash}-<purpose>. Lambda function purposes have a 51-character budget; layer purposes have a 127-character budget for Lambda's 140-character layer-name limit. Layer version suffixes are provider-managed.

Example

CODE
const layer = new AwsLambda({
  layer: {
    name: 'sharedDependencies',
    codePath: './dist/layer.zip',
    compatibleRuntimes: ['nodejs22.x'],
  },
});

Constructors

new AwsLambda( args: AwsLambdaArgs, options?: ComponentResourceOptions, ): AwsLambda

Parameters

  • args (AwsLambdaArgs)
  • options (ComponentResourceOptions, optional)

Returns

AwsLambda

Hierarchy

  • ComponentResource
  • AwsLambda

Properties

arn: Output<string> | undefined

readonly

Lambda function ARN, when configured.

function: Function | undefined

readonly

Underlying Lambda function resource, when configured.

functionName: Output<string> | undefined

readonly

Lambda function name, when configured.

functionReference: AwsLambdaFunctionReference | undefined

readonly

Function reference used by cross-service integrations.

functionUrl: Output<string> | undefined

readonly

Lambda Function URL endpoint, when configured.

functionUrlResource: FunctionUrl | undefined

readonly

Lambda Function URL resource, when configured.

invokeArn: Output<string> | undefined

readonly

API Gateway invoke ARN, when configured.

layer: LayerVersion | undefined

readonly

Underlying Lambda layer-version resource, when configured.

layerArn: Output<string> | undefined

readonly

Layer ARN without the version suffix, when configured.

layerVersion: Output<string> | undefined

readonly

Layer version, when configured.

layerVersionArn: Output<string> | undefined

readonly

Versioned layer ARN, when configured.

logGroup: AwsCloudwatch | undefined

readonly

Referenced log-group input, when the function capability configures logging.

logGroupName: Output<string> | undefined

readonly

Referenced log-group name, when configured.

qualifiedArn: Output<string> | undefined

readonly

Qualified ARN for the published function version, when configured.

qualifiedInvokeArn: Output<string> | undefined

readonly

Qualified API Gateway invoke ARN for the published function version, when configured.

urn: Output<string>

readonly

Inherited from urn

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

version: Output<string> | undefined

readonly

Latest published function version, when configured.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

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

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

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.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

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

protected

Inherited from registerOutputs

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

Component resources 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.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

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

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>