Skip to content

ApiLambdaScalar

Open in ChatGPTOpen in Claude

Defined in: packages/core/src/types/lambda.ts:224

Scalar (single-route) REST API config — today’s exact shape (D2).

optional apiKey?: boolean

Defined in: packages/core/src/types/lambda.ts:231

Require an API key on this route (orthogonal to authorizer). Default off.


optional architecture?: LambdaArchitecture

Defined in: packages/core/src/types/lambda.ts:130

CPU architecture. Defaults to arm64 (Graviton — cheaper + faster for most workloads). Lambda@Edge MUST use x86_64.

BaseLambdaConfig.architecture


optional authorizer?: LambdaAuthorizer

Defined in: packages/core/src/types/lambda.ts:229


optional basePath?: never

Defined in: packages/core/src/types/lambda.ts:235

basePath only meaningful with routes (D9).


optional bundling?: NodejsBundlingConfig | PythonBundlingConfig | GoBundlingConfig

Defined in: packages/core/src/types/lambda.ts:191

Runtime-specific bundling config

BaseLambdaConfig.bundling


optional constructId?: string

Defined in: packages/core/src/types/lambda.ts:145

CloudFormation logical ID override. Use when migrating existing lambdas to preserve physical resource IDs.

BaseLambdaConfig.constructId


optional customFunctionName?: (appName, stageName) => string

Defined in: packages/core/src/types/lambda.ts:151

Custom function name factory. If omitted, the framework generates: ${appName}-${name}-${stageName}

string

string

string

BaseLambdaConfig.customFunctionName


description: string

Defined in: packages/core/src/types/lambda.ts:133

Human-readable description (shows in AWS console)

BaseLambdaConfig.description


optional enableTracing?: boolean

Defined in: packages/core/src/types/lambda.ts:157

Enable X-Ray tracing. Default: true. Not supported on Lambda@Edge.

BaseLambdaConfig.enableTracing


entry: string

Defined in: packages/core/src/types/lambda.ts:112

Handler entry point, relative to the project root. Node.js: path to .ts file (e.g. “lambdas/modules/url/api/create/index.ts”) Python: path to .py file (e.g. “lambdas/url/create.py”) Go: path to package (e.g. “lambdas/url/create”)

BaseLambdaConfig.entry


optional environment?: Record<string, string>

Defined in: packages/core/src/types/lambda.ts:182

Environment variables. Supports {{token}} syntax for registry values and ${ssm:/path} for SSM parameters.

Note: Lambda@Edge does not support environment variables. For edge lambdas, use bundling.define instead.

BaseLambdaConfig.environment


kind: "api"

Defined in: packages/core/src/types/lambda.ts:225

Execution context.

BaseLambdaConfig.kind


optional logLevel?: "ERROR" | "DEBUG" | "INFO" | "WARN" | "SILENT"

Defined in: packages/core/src/types/lambda.ts:154

Powertools log level. Default: INFO

BaseLambdaConfig.logLevel


optional logRetentionDays?: number

Defined in: packages/core/src/types/lambda.ts:173

CloudWatch log group retention in days for this lambda. Overrides the project-wide default from lambdaDefaults.logRetentionDays.

Framework defaults (when not set here or in lambdaDefaults):

  • dev: 30 days
  • prod: 90 days

Set to 0 to disable retention (logs kept forever — not recommended in prod). Not supported on Lambda@Edge (edge functions use CloudFront logging).

BaseLambdaConfig.logRetentionDays


optional logSensitive?: "true" | "false"

Defined in: packages/core/src/types/lambda.ts:160

Set to “true” to include sensitive fields in logs (non-prod only)

BaseLambdaConfig.logSensitive


optional memorySize?: number

Defined in: packages/core/src/types/lambda.ts:136

Memory in MB. Default: 512

BaseLambdaConfig.memorySize


method: HttpMethod

Defined in: packages/core/src/types/lambda.ts:226


name: string

Defined in: packages/core/src/types/lambda.ts:99

Unique name for this lambda. Used in function names and logical IDs. Convention: kebab-case, e.g. “create-url”, “process-payment”

BaseLambdaConfig.name


path: string

Defined in: packages/core/src/types/lambda.ts:228

API path, e.g. “/users/{id}“


optional permissionsSpec?: PermissionSpec[]

Defined in: packages/core/src/types/lambda.ts:188

Declarative IAM permissions. The constructs package translates these into PolicyStatements.

BaseLambdaConfig.permissionsSpec


optional routes?: never

Defined in: packages/core/src/types/lambda.ts:233

Scalar form forbids routes — setting both is a compile error (D1).


optional runtime?: LambdaRuntime

Defined in: packages/core/src/types/lambda.ts:124

Lambda runtime. Defaults to nodejs24 (latest LTS).

Examples: “nodejs24” → Node.js 24.x (latest) “nodejs22” → Node.js 22.x (LTS — EOL April 2027) “python312” → Python 3.12 “python311” → Python 3.11 “go” → Go on provided.al2023

BaseLambdaConfig.runtime


optional timeoutSeconds?: number

Defined in: packages/core/src/types/lambda.ts:139

Timeout in seconds. Default: 10

BaseLambdaConfig.timeoutSeconds

© 2026 Axis Tech. Powered by axis-tech.co.