diff --git a/README.md b/README.md index 7e976f6..198b3b6 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ No modules. | [email](#input\_email) | List of e-mail addresses subscribing to the SNS topic. Default is empty list. | `list(string)` | `[]` | no | | [ignore\_states](#input\_ignore\_states) | Suppress warnings for the listed MSK states. Default: ['MAINTENANCE'] | `list(string)` |
[
"MAINTENANCE"
]
| no | | [log\_retion\_period\_in\_days](#input\_log\_retion\_period\_in\_days) | Number of days logs will be retained. Default is 365 days. | `number` | `365` | no | +| [memory\_size](#input\_memory\_size) | Amount of memory in MByte that the Lambda Function can use at runtime. Default is 160. | `number` | `160` | no | | [schedule\_expression](#input\_schedule\_expression) | The schedule expression for the CloudWatch event rule. Default is 'rate(15 minutes)'. | `string` | `"rate(15 minutes)"` | no | | [tags](#input\_tags) | A map of tags to add to all resources. Default is empty map. | `map(string)` | `{}` | no | diff --git a/main.tf b/main.tf index 3d285fa..b8883cb 100644 --- a/main.tf +++ b/main.tf @@ -101,7 +101,7 @@ resource "aws_lambda_function" "msk_health_lambda" { handler = "index.lambda_handler" runtime = "python3.11" reserved_concurrent_executions = 1 - memory_size = 128 + memory_size = var.memory_size source_code_hash = data.archive_file.status_checker_code.output_base64sha256 timeout = 60 tags = var.tags diff --git a/variables.tf b/variables.tf index 6eb5499..a0e1a43 100644 --- a/variables.tf +++ b/variables.tf @@ -24,6 +24,16 @@ variable "log_retion_period_in_days" { } } +variable "memory_size" { + type = number + description = "Amount of memory in MByte that the Lambda Function can use at runtime. Default is 160." + default = 160 + validation { + condition = var.memory_size >= 128 && var.memory_size <= 10240 + error_message = "memory_size must be between 128 and 10240" + } +} + variable "schedule_expression" { description = "The schedule expression for the CloudWatch event rule. Default is 'rate(15 minutes)'." type = string