AwsLambda
AWS Lambda service component.
Remarks
Naming:
- Type
${namespace}:aws:AwsLambda; function roots use capabilitylambdaand the shared identityargs.function.functionName, producing${env}-${projectHash}-lambda-${sanitised args.function.functionName}. - Layer roots use capability
lambda-layerand the shared identityargs.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
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
ComponentResourceAwsLambda
Properties
arn: Output<string> | undefined
Lambda function ARN, when configured.
function: Function | undefined
Underlying Lambda function resource, when configured.
functionName: Output<string> | undefined
Lambda function name, when configured.
functionReference: AwsLambdaFunctionReference | undefined
Function reference used by cross-service integrations.
functionUrl: Output<string> | undefined
Lambda Function URL endpoint, when configured.
functionUrlResource: FunctionUrl | undefined
Lambda Function URL resource, when configured.
invokeArn: Output<string> | undefined
API Gateway invoke ARN, when configured.
layer: LayerVersion | undefined
Underlying Lambda layer-version resource, when configured.
layerArn: Output<string> | undefined
Layer ARN without the version suffix, when configured.
layerVersion: Output<string> | undefined
Layer version, when configured.
layerVersionArn: Output<string> | undefined
Versioned layer ARN, when configured.
logGroup: AwsCloudwatch | undefined
Referenced log-group input, when the function capability configures logging.
logGroupName: Output<string> | undefined
Referenced log-group name, when configured.
qualifiedArn: Output<string> | undefined
Qualified ARN for the published function version, when configured.
qualifiedInvokeArn: Output<string> | undefined
Qualified API Gateway invoke ARN for the published function version, when configured.
urn: Output<string>
Inherited from urn
The stable logical URN used to distinctly address a resource, both before and after deployments.
version: Output<string> | undefined
Latest published function version, when configured.
Methods
getData(): Promise<any>
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>
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
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>
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>