From 85c554c09bbbda3af47e459b04aa0a2d3a795012 Mon Sep 17 00:00:00 2001 From: wayne-root Date: Thu, 9 May 2024 16:18:25 +0800 Subject: [PATCH] Add event source mapping var --- README.md | 11 ++++++----- main.tf | 2 ++ variables.tf | 6 ++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 385988e..d3dc42f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + ## Requirements | Name | Version | @@ -12,7 +12,7 @@ | Name | Version | |------|---------| | [archive](#provider\_archive) | 2.3.0 | -| [aws](#provider\_aws) | 5.36.0 | +| [aws](#provider\_aws) | 5.45.0 | ## Modules @@ -72,6 +72,7 @@ | [description](#input\_description) | Lambda Function Description | `string` | `""` | no | | [environment\_variables](#input\_environment\_variables) | A map that defines environment variables for the Lambda Function. | `map(string)` | `{}` | no | | [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | Amount of ephemeral storage (/tmp) in MB your Lambda Function can use at runtime. Valid value between 512 MB to 10,240 MB (10 GB). | `number` | `512` | no | +| [event\_source\_mapping](#input\_event\_source\_mapping) | Map of event source mapping | `any` | `{}` | no | | [function\_name](#input\_function\_name) | Lambda Function Name | `string` | n/a | yes | | [function\_prefix](#input\_function\_prefix) | Prefix for the IAM role for lambda functions | `string` | `""` | no | | [github\_repo](#input\_github\_repo) | GitHub repo to grant access to assume a role via OIDC. |
object({
repo = string
branches = optional(list(string), [])
environments = optional(list(string), ["*"])
tags = optional(list(string), [])

# Custom Role name. It will autocreate based on repo if not provided
role_name = optional(string)
})
| n/a | yes | @@ -84,10 +85,10 @@ | [lambda\_at\_edge](#input\_lambda\_at\_edge) | Set this to true if using Lambda@Edge, to enable publishing, limit the timeout, and allow edgelambda.amazonaws.com to invoke the function | `bool` | `false` | no | | [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 | | [layers](#input\_layers) | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. | `list(string)` | `null` | no | -| [logging\_application\_log\_level](#input\_logging\_application\_log\_level) | The application log level of your lambda | `string` | `null` | no | +| [logging\_application\_log\_level](#input\_logging\_application\_log\_level) | The application log level of your lambda | `string` | `"INFO"` | no | | [logging\_log\_format](#input\_logging\_log\_format) | Logging format of your lambda | `string` | `"Text"` | no | | [logging\_log\_group](#input\_logging\_log\_group) | Log group that your lambda will use | `string` | `null` | no | -| [logging\_system\_log\_level](#input\_logging\_system\_log\_level) | System log level of your lambda | `string` | `null` | no | +| [logging\_system\_log\_level](#input\_logging\_system\_log\_level) | System log level of your lambda | `string` | `"INFO"` | no | | [managed\_policy\_arns](#input\_managed\_policy\_arns) | List of AWS managed policies to attach to IAM role for Lambda Function | `list(string)` | `null` | no | | [memory\_size](#input\_memory\_size) | Amount of memory in MB your Lambda Function can use at runtime. Valid value between 128 MB to 10,240 MB (10 GB), in 64 MB increments. | `number` | `128` | no | | [number\_of\_managed\_policies](#input\_number\_of\_managed\_policies) | Number of AWS managed policies to attach to IAM role for Lambda Function | `number` | `0` | no | @@ -128,4 +129,4 @@ | [lambda\_role\_name](#output\_lambda\_role\_name) | The name of the IAM role created for the Lambda Function | | [lambda\_role\_unique\_id](#output\_lambda\_role\_unique\_id) | The unique id of the IAM role created for the Lambda Function | | [qualified\_arn](#output\_qualified\_arn) | The qualified arn of the lambda function to be associated with Cloudfront as a Lambda@Edge function | - + diff --git a/main.tf b/main.tf index 18e9a20..0f95bb9 100644 --- a/main.tf +++ b/main.tf @@ -80,4 +80,6 @@ module "lambda" { logging_log_format = var.logging_log_format logging_log_group = var.logging_log_group logging_system_log_level = var.logging_system_log_level + + event_source_mapping = var.event_source_mapping } diff --git a/variables.tf b/variables.tf index 374a72f..281411b 100644 --- a/variables.tf +++ b/variables.tf @@ -292,6 +292,12 @@ variable "logging_system_log_level" { } } +variable "event_source_mapping" { + description = "Map of event source mapping" + type = any + default = {} +} + ############################################ # Lambda Permissions (for allowed triggers) ############################################