The memory size of a Lambda function in Terraform can be configured using the memory_size
argument within the aws_lambda_function resource
. It can be set to a value between 128 MB and 10,240 MB (10 GB) in 64 MB increments. This memory allocation affects the function’s computational resources and execution time.
Additional note: While the memory size determines the computational resources, the ephemeral storage size (configured separately) determines the amount of temporary storage available to your function for file operations, caching, or other data processing tasks.