Skip to content

Commit 5a7a653

Browse files
allow setting memory of lambda
1 parent 761e390 commit 5a7a653

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module "lambda" {
7878
handler = "${var.lambda_handler}"
7979
runtime = "${var.lambda_runtime}"
8080
role = "${aws_iam_role.lambda_role.arn}"
81+
memory = "${var.lambda_memory}"
8182
database_uri = "<UPDATE_ME>"
8283

8384
# database_uri = "${module.rds_instance.url}"

modules/lambda/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resource "aws_lambda_function" "lambda" {
66
handler = "${var.handler}"
77
runtime = "${var.runtime}"
88
source_code_hash = "${var.hash}"
9+
memory_size = "${var.memory}"
910

1011
vpc_config {
1112
subnet_ids = ["${var.subnet_ids}"]

modules/lambda/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ variable "handler" {
2222
description = "The handler name of the lambda function"
2323
}
2424

25+
variable "memory" {
26+
description = "The memory size of the lambda function"
27+
}
28+
2529
variable "role" {
2630
description = "IAM role attached to the Lambda Function (ARN)"
2731
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ variable "lambda_handler" {
6868
description = "Lambda Function Handler"
6969
}
7070

71+
variable "lambda_memory" {
72+
description = "Lambda memory size, 128 MB to 3,008 MB, in 64 MB increments"
73+
default = "128"
74+
}
75+
7176
####################
7277
# API Gateway
7378
####################

0 commit comments

Comments
 (0)