Skip to content

Commit

Permalink
Merge pull request #79 from ministryofjustice/add-memory-size-arg
Browse files Browse the repository at this point in the history
adding in variable for memory_size arg of lambda function
  • Loading branch information
LavMatt authored Jun 9, 2023
2 parents 7706551 + 495c8f7 commit 6728201
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ No modules.
| <a name="input_function_name"></a> [function\_name](#input\_function\_name) | A unique name for your Lambda Function | `string` | `""` | no |
| <a name="input_image_uri"></a> [image\_uri](#input\_image\_uri) | The ECR image URI containing the function's deployment package. | `string` | `null` | no |
| <a name="input_lambda_role"></a> [lambda\_role](#input\_lambda\_role) | IAM role ARN attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See Lambda Permission Model for more details. | `string` | `""` | no |
| <a name="input_memory_size"></a> [memory\_size](#input\_memory\_size) | Amount of memory in MB your Lambda Function can use at runtime | `number` | `128` | no |
| <a name="input_package_type"></a> [package\_type](#input\_package\_type) | The Lambda deployment package type. Valid options: Image | `string` | `"Image"` | no |
| <a name="input_policy_arns"></a> [policy\_arns](#input\_policy\_arns) | List of policy statements ARN to attach to Lambda Function role | `list(string)` | `[]` | no |
| <a name="input_policy_json"></a> [policy\_json](#input\_policy\_json) | An policy document as JSON to attach to the Lambda Function role | `string` | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ resource "aws_lambda_function" "this" { #tfsec:ignore:aws-lambda-enable-tracing
package_type = var.package_type
role = var.create_role ? aws_iam_role.this[0].arn : var.lambda_role
timeout = var.timeout
memory_size = var.memory_size
dynamic "tracing_config" {
for_each = var.tracing_mode != null ? [1] : []
content {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ variable "allowed_triggers" {
type = map(any)
default = {}
}

variable "memory_size" {
description = "Amount of memory in MB your Lambda Function can use at runtime"
type = number
default = 128
}

0 comments on commit 6728201

Please sign in to comment.