AwsServerlessLayerDefinitionArgs

interface AwsServerlessLayerDefinitionArgs extends Omit<AwsLambdaLayerArgs, 'name'> { code?: Input<Archive | undefined>; codePath?: string; compatibleArchitectures?: Input<Input<string>[] | undefined>; compatibleRuntimes?: Input<Input<string>[] | undefined>; description?: Input<string | undefined>; licenseInfo?: Input<string | undefined>; region?: Input<string | undefined>; s3Bucket?: Input<string | undefined>; s3Key?: Input<string | undefined>; s3ObjectVersion?: Input<string | undefined>; skipDestroy?: Input<boolean | undefined>; sourceCodeHash?: Input<string | undefined>; }

Lambda layer definition for keyed serverless orchestration.

Example

CODE
const layers: Record<string, AwsServerlessLayerDefinitionArgs> = {
  sharedDependencies: {
    codePath: './dist/layer',
    compatibleRuntimes: ['nodejs22.x'],
  },
};

Hierarchy

  • Omit<AwsLambdaLayerArgs, "name">
  • AwsServerlessLayerDefinitionArgs

Properties

code: Input<Archive | undefined>

Inherited from code

Path to the function's deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.

codePath: string

Inherited from codePath

Optional local archive path packaged as a FileArchive.

compatibleArchitectures: Input<Input<string>[] | undefined>

Inherited from compatibleArchitectures

List of Architectures this layer is compatible with. Currently x8664 and arm64 can be specified.

compatibleRuntimes: Input<Input<string>[] | undefined>

Inherited from compatibleRuntimes

List of Runtimes this layer is compatible with. Up to 15 runtimes can be specified.

description: Input<string | undefined>

Inherited from description

Description of what your Lambda Layer does.

licenseInfo: Input<string | undefined>

Inherited from licenseInfo

License info for your Lambda Layer. See License Info.

region: Input<string | undefined>

Inherited from region

Region where this resource will be managed. Defaults to the Region set in the provider configuration.

s3Bucket: Input<string | undefined>

Inherited from s3Bucket

S3 bucket location containing the function's deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.

s3Key: Input<string | undefined>

Inherited from s3Key

S3 key of an object containing the function's deployment package. Conflicts with filename.

s3ObjectVersion: Input<string | undefined>

Inherited from s3ObjectVersion

Object version containing the function's deployment package. Conflicts with filename.

skipDestroy: Input<boolean | undefined>

Inherited from skipDestroy

Whether to retain the old version of a previously deployed Lambda Layer. Default is false. When this is not set to true, changing any of compatibleArchitectures, compatibleRuntimes, description, filename, layerName, licenseInfo, s3Bucket, s3Key, s3ObjectVersion, or sourceCodeHash forces deletion of the existing layer version and creation of a new layer version.

sourceCodeHash: Input<string | undefined>

Inherited from sourceCodeHash

Virtual attribute used to trigger replacement when source code changes. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3Key. The usual way to set this is filebase64sha256("file.zip") or base64sha256(file("file.zip")), where "file.zip" is the local filename of the lambda layer source archive.