From d87c994a0a9eb3c00735f0a379403d0daffc24ff Mon Sep 17 00:00:00 2001 From: Ian <80067490+Ian-Soares@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:08:02 -0300 Subject: [PATCH] fix: adding memory size variable to complete module (#3) --- infrastructure/ebs-checker/main.tf | 1 + infrastructure/modules/complete/main.tf | 14 ++++++++------ infrastructure/modules/complete/variables.tf | 6 ++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/infrastructure/ebs-checker/main.tf b/infrastructure/ebs-checker/main.tf index 7917bd7..5dd5264 100644 --- a/infrastructure/ebs-checker/main.tf +++ b/infrastructure/ebs-checker/main.tf @@ -7,6 +7,7 @@ module "complete" { lambda_function_handler = "lambda_function.lambda_handler" lambda_function_runtime = "python3.8" lambda_function_timeout = 120 + lambda_function_memory_size = 1028 lambda_function_source_code_path = "../../lambdas/ebs-checker" lambda_function_custom_policy_arns = [ "arn:aws:iam::${data.aws_caller_identity.current.account_id}:policy/ebs-modify-policy", diff --git a/infrastructure/modules/complete/main.tf b/infrastructure/modules/complete/main.tf index 9383414..89717f9 100644 --- a/infrastructure/modules/complete/main.tf +++ b/infrastructure/modules/complete/main.tf @@ -1,12 +1,14 @@ module "lambda_function" { source = "../lambda-function" - create = try(var.create_lambda_function, true) - name = var.lambda_function_name - description = try(var.lambda_function_description, "") - handler = try(var.lambda_function_handler, "lambda_function.lambda_handler") - runtime = try(var.lambda_function_runtime, "python3.8") - timeout = try(var.lambda_function_timeout, 120) + create = try(var.create_lambda_function, true) + name = var.lambda_function_name + description = try(var.lambda_function_description, "") + handler = try(var.lambda_function_handler, "lambda_function.lambda_handler") + runtime = try(var.lambda_function_runtime, "python3.8") + timeout = try(var.lambda_function_timeout, 120) + memory_size = try(var.lambda_function_memory_size) + source_code_path = var.lambda_function_source_code_path vpc_config = try(var.lambda_vpc_config, null) != null ? { subnet_ids = var.lambda_vpc_config.subnet_ids diff --git a/infrastructure/modules/complete/variables.tf b/infrastructure/modules/complete/variables.tf index add7f49..a6ddf0d 100644 --- a/infrastructure/modules/complete/variables.tf +++ b/infrastructure/modules/complete/variables.tf @@ -35,6 +35,12 @@ variable "lambda_function_timeout" { type = number } +variable "lambda_function_memory_size" { + description = "The memory size of the Lambda function" + type = number + default = 128 +} + variable "lambda_function_source_code_path" { description = "The path to the source code of the Lambda function" type = string