From 912e11dc38416650ac07e0762a5e469a030032bd Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Sat, 11 Dec 2021 15:35:54 -0500 Subject: [PATCH] feat: add support for recreating package locally if not missing/not present (#158) --- .pre-commit-config.yaml | 2 +- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ada986a..7cbabd0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.60.0 + rev: v1.61.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/README.md b/README.md index 87773996..87a4fd64 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ See the [functions](https://github.com/terraform-aws-modules/terraform-aws-notif | [lambda\_function\_vpc\_subnet\_ids](#input\_lambda\_function\_vpc\_subnet\_ids) | List of subnet ids when Lambda Function should run in the VPC. Usually private or intra subnets. | `list(string)` | `null` | no | | [lambda\_role](#input\_lambda\_role) | IAM role attached to the Lambda Function. If this is set then a role will not be created for you. | `string` | `""` | no | | [log\_events](#input\_log\_events) | Boolean flag to enabled/disable logging of incoming events | `bool` | `false` | no | +| [recreate\_missing\_package](#input\_recreate\_missing\_package) | Whether to recreate missing Lambda package if it is missing locally or not | `bool` | `true` | no | | [reserved\_concurrent\_executions](#input\_reserved\_concurrent\_executions) | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations | `number` | `-1` | no | | [slack\_channel](#input\_slack\_channel) | The name of the channel in Slack for notifications | `string` | n/a | yes | | [slack\_emoji](#input\_slack\_emoji) | A custom emoji that will appear on Slack messages | `string` | `":aws:"` | no | diff --git a/main.tf b/main.tf index b304c038..bf5a1ae1 100644 --- a/main.tf +++ b/main.tf @@ -79,6 +79,7 @@ module "lambda" { handler = "notify_slack.lambda_handler" source_path = "${path.module}/functions/notify_slack.py" + recreate_missing_package = var.recreate_missing_package runtime = "python3.8" timeout = 30 kms_key_arn = var.kms_key_arn diff --git a/variables.tf b/variables.tf index b131619b..76126ec0 100644 --- a/variables.tf +++ b/variables.tf @@ -66,6 +66,12 @@ variable "kms_key_arn" { default = "" } +variable "recreate_missing_package" { + description = "Whether to recreate missing Lambda package if it is missing locally or not" + type = bool + default = true +} + variable "log_events" { description = "Boolean flag to enabled/disable logging of incoming events" type = bool