diff --git a/test/unit-test/main.tf b/test/unit-test/main.tf index e0ab535..838bf6e 100644 --- a/test/unit-test/main.tf +++ b/test/unit-test/main.tf @@ -37,6 +37,8 @@ module "lambda_function_in_vpc" { package_type = "Zip" filename = data.archive_file.lambda-zip.output_path source_code_hash = data.archive_file.lambda-zip.output_base64sha256 + handler = "test.lambda_handler" + runtime = "python3.8" tags = local.tags function_name = "lambda-function-in-vpc-test" create_role = true diff --git a/test/unit-test/test-zip/test.py b/test/unit-test/test-zip/test.py index 7a27a02..a1d5ff9 100644 --- a/test/unit-test/test-zip/test.py +++ b/test/unit-test/test-zip/test.py @@ -1,5 +1,5 @@ import sys -def handler(event, context): +def lambda_handler(event, context): return 'Hello from AWS Lambda using Python' + sys.version + '!' diff --git a/variables.tf b/variables.tf index 1766e10..3b8615d 100644 --- a/variables.tf +++ b/variables.tf @@ -99,6 +99,18 @@ variable "source_code_hash" { default = null } +variable "handler" { + description = "Lambda Function entrypoint in your code" + type = string + default = "" +} + +variable "runtime" { + description = "Lambda function runtime" + type = string + default = "" +} + variable "timeout" { description = "The amount of time your Lambda Function has to run in seconds." type = number