Skip to content

Commit

Permalink
EPBR-7677: Add and increase memory size of lambda in prod
Browse files Browse the repository at this point in the history
As the lambda processing logs was returning OutOfMemory errors.
  • Loading branch information
al01010 committed Dec 10, 2024
1 parent b567958 commit 0d06d37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions service-infrastructure/logging/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ resource "aws_lambda_function" "forward_logs_s3_cloudwatch" {
role = aws_iam_role.lambda_forward_logs_s3_cloudwatch_role[0].arn
handler = "index.handler"
runtime = "nodejs20.x"
memory_size = var.memory_size
timeout = 30

// Redeploy when lambda function code change
Expand Down
4 changes: 4 additions & 0 deletions service-infrastructure/logging/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ variable "is_cloudwatch_insights_on" {
type = number
}

variable "memory_size" {
type = number
default = 128
}
1 change: 1 addition & 0 deletions service-infrastructure/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ module "logging" {
prefix = local.prefix
region = var.region
is_cloudwatch_insights_on = 1
memory_size = var.environment == "prod" ? 256 : 128
}

module "fluentbit_ecr" {
Expand Down

0 comments on commit 0d06d37

Please sign in to comment.