Skip to main content

LambdaFunctionSchema

The LambdaFunctionSchema class is the schema for the LambdaFunction resource, which represents an AWS Lambda function running a container image. Terraform provisions it as aws_lambda_function, with an aws_lambda_function_url that only signed requests may call. Each caller of the URL is admitted by a resource of its own: a role by LambdaFunctionPermission, a CloudFront distribution by LambdaFunctionCloudFrontPermission.

The function writes its logs to the log group it is given, which its role may write to and not create.

@group

Resources/LambdaFunction

@overrideProperty

parents - The IAM role the function runs as, the published image it runs, and the log group it writes to.

@overrideProperty

resourceId - The resource id is of format lambda-function-<function-name>.

Hierarchy

  • BaseResourceSchema
    • LambdaFunctionSchema

Index

Properties

inheritedlocalResourceId

localResourceId: string

The ID the resource was created with, unique within its scope.

inheritedparents

parents: IResourceReference[]

The resources this one is built on top of.

properties

properties: { architecture: arm64 | x86_64; awsAccountId: string; awsRegionId: string; environmentVariables: Record<string, string>; functionName: string; imageCommand: string[]; invokeMode: BUFFERED | RESPONSE_STREAM; memoryInMegabytes: number; reservedConcurrency: number | null; timeoutInSeconds: number }

Input properties.

  • properties.architecture - The processor the function runs on. The image must be built for it.
  • properties.awsAccountId - The AWS account id.
  • properties.awsRegionId - The AWS region id.
  • properties.environmentVariables - Values the function reads out of its environment.
  • properties.functionName - The name of the function. Part of its identity.
  • properties.imageCommand - The command the image runs, replacing its own. Empty keeps the image's own command.
  • properties.invokeMode - How the function's URL returns a response: BUFFERED, whole and up to 6 MB, or RESPONSE_STREAM, streamed as the function writes it, up to 200 MB.
  • properties.memoryInMegabytes - How much memory the function gets, from 128 to 10240. It also decides how much CPU the function gets.
  • properties.reservedConcurrency - How many instances of the function may run at once, reserved out of the account's concurrency. Left out, nothing is reserved.
  • properties.timeoutInSeconds - How long an invocation may run before Lambda stops it, from 1 to 900.

Type declaration

  • architecture: arm64 | x86_64
  • awsAccountId: string
  • awsRegionId: string
  • environmentVariables: Record<string, string>
  • functionName: string
  • imageCommand: string[]
  • invokeMode: BUFFERED | RESPONSE_STREAM
  • memoryInMegabytes: number
  • reservedConcurrency: number | null
  • timeoutInSeconds: number

inheritedresourceId

resourceId: string

The ID of the resource, unique across the infrastructure: its localResourceId, followed by a hash of its scope when it has one.

response

response: { Arn?: string; FunctionName?: string; FunctionUrl?: string; FunctionUrlDomainName?: string } = { Arn: 'arn:aws:lambda:us-east-1:000000000000:function:mock-function', FunctionName: 'mock-function', FunctionUrl: 'https://mock-function.lambda-url.us-east-1.on.aws/', FunctionUrlDomainName: 'mock-function.lambda-url.us-east-1.on.aws', }

Saved response.

  • response.Arn - The ARN of the function.
  • response.FunctionName - The name of the function.
  • response.FunctionUrl - The URL the function answers on.
  • response.FunctionUrlDomainName - The host name of the URL, which a CloudFront origin names.

Type declaration

  • optionalArn?: string
  • optionalFunctionName?: string
  • optionalFunctionUrl?: string
  • optionalFunctionUrlDomainName?: string

inheritedscope

scope: string[]

The contexts of the models the resource is placed under, derived from where the node creating it sits in the model graph. Octo sets it; a resource created outside a model action has none.

inheritedtags

tags: {}

The tags applied to the resource.


Type declaration

  • [key string]: string