Optional
Readonly
adotSpecify the configuration of AWS Distro for OpenTelemetry (ADOT) instrumentation
https://aws-otel.github.io/docs/getting-started/lambda
Optional
Readonly
allowWhether to allow the Lambda to send all network traffic
If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.
true
Optional
Readonly
allowLambda Functions in a public subnet can NOT access the internet. Use this property to acknowledge this limitation and still place the function in a public subnet.
false
Optional
Readonly
architectureThe system architectures compatible with this lambda function.
Architecture.X86_64
Optional
Readonly
codeCode signing config associated with this function
Optional
Readonly
currentOptions for the lambda.Version
resource automatically created by the
fn.currentVersion
method.
VersionOptions
Optional
Readonly
deadThe SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify deadLetterTopic
property instead.
deadLetterQueueEnabled
is true
Optional
Readonly
deadEnabled DLQ. If deadLetterQueue
is undefined,
an SQS queue with default options will be defined for your Function.
deadLetterQueue
is set, which implies DLQ is enabled.Optional
Readonly
deadThe SNS topic to use as a DLQ.
Note that if deadLetterQueueEnabled
is set to true
, an SQS queue will be created
rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.
Optional
Readonly
descriptionA description of the function.
Optional
Readonly
environmentKey-value pairs that Lambda caches and makes available for your Lambda functions. Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.
Optional
Readonly
environmentThe AWS KMS key that's used to encrypt your function's environment variables.
Optional
Readonly
ephemeralThe size of the function’s /tmp directory in MiB.
512 MiB
Optional
Readonly
eventsEvent sources for this function.
You can also add event sources using addEventSource
.
The filename for an executable package within the bucket [[GuDistributionBucketParameter
]].
We'll look for fileName
on the path "bucket/stack/stage/app/
Optional
Readonly
filesystemThe filesystem configuration for the lambda function
Optional
Readonly
functionA name for the function.
Readonly
handlerThe name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html.
Use Handler.FROM_IMAGE
when defining a function from a Docker image.
NOTE: If you specify your source code as inline text by specifying the ZipFile property within the Code property, specify index.function_name as the handler.
Optional
Readonly
initialInitial policy statements to add to the created Lambda Role.
You can call addToRolePolicy
to the created lambda to add statements post creation.
Optional
Readonly
insightsSpecify the version of CloudWatch Lambda insights to use for monitoring
When used with DockerImageFunction
or DockerImageCode
, the Docker image should have
the Lambda insights agent installed.
Optional
Readonly
layersA list of layers to add to the function's execution environment. You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.
Optional
Readonly
logThe number of days log events are kept in CloudWatch Logs. When updating
this property, unsetting it doesn't remove the log retention policy. To
remove the retention policy, set the value to INFINITE
.
logs.RetentionDays.INFINITE
Optional
Readonly
logWhen log retention is specified, a custom resource attempts to create the CloudWatch log group. These options control the retry policy when interacting with CloudWatch APIs.
Optional
Readonly
logThe IAM role for the Lambda function associated with the custom resource that sets the retention policy.
Optional
Readonly
maxThe maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds Maximum: 6 hours
Duration.hours(6)
Optional
Readonly
memoryThe amount of memory, in MB, that is allocated to your Lambda function. Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.
128
Optional
Readonly
onThe destination for failed invocations.
Optional
Readonly
onThe destination for successful invocations.
Optional
Readonly
profilingEnable profiling.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
Optional
Readonly
profilingProfiling Group.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
profiling
is set.Optional
Readonly
reservedThe maximum of concurrent executions you want to reserve for the function.
https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
Optional
Readonly
retryThe maximum number of times to retry when the function returns an error.
Minimum: 0 Maximum: 2
2
Optional
Readonly
roleLambda execution role.
This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal.
The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.
The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole".
addToRolePolicy
.Readonly
runtimeThe runtime environment for the Lambda function that you are uploading. For valid values, see the Runtime property in the AWS Lambda Developer Guide.
Use Runtime.FROM_IMAGE
when defining a function from a Docker image.
Optional
Readonly
securityThe list of security groups to associate with the Lambda's network interfaces.
Only used if 'vpc' is supplied.
Optional
throttlingAlarm if throttling occurs. Note, it is also worth considering a
concurrency limit (the reservedConcurrentExecutions
prop) if you are
concerned about throttling.
https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
Optional
Readonly
timeoutThe function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time.
Duration.seconds(3)
Optional
Readonly
tracingEnable AWS X-Ray Tracing for Lambda Function.
Tracing.Disabled
Optional
Readonly
vpcVPC network to place Lambda network interfaces
Specify this if the Lambda function needs to access resources in a VPC.
This is required when vpcSubnets
is specified.
Optional
Readonly
vpcWhere to place the network interfaces within the VPC.
This requires vpc
to be specified in order for interfaces to actually be
placed in the subnets. If vpc
is not specify, this will raise an error.
Note: Internet access for Lambda Functions requires a NAT Gateway, so picking
public subnets is not allowed (unless allowPublicSubnet
is set to true
).
Generated using TypeDoc
Configuration options for the [[
GuScheduledLambda
]] pattern.For all lambda function configuration options, see [[
GuFunctionProps
]].The
schedule
property determines when your lambda is invoked. For example, to invoke the lambda every 5 minutes, use:To invoke the lambda every weekday at 8am, use:
It is advisable to configure an alarm based on the lambda's error percentage. To do this, add the
monitoringConfiguration
property. The required properties for this are:Other alarm properties (e.g. alarm name and description) will be pre-populated with sensible defaults. For a full list of optional properties, see [[
GuLambdaErrorPercentageMonitoringProps
]].If your team do not use CloudWatch, it's possible to opt-out with the following configuration: