From 1325241b8b5ee5bcd4a01a3b5da65f8500dd580e Mon Sep 17 00:00:00 2001 From: Vladimir Samoylov <51059484+cageyv@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:24:51 +0700 Subject: [PATCH] new var: recreate missing package (#30) * new var: lambda_recreate_missing_package * README.md version update --- README.md | 24 ++++++++++++++---------- main.tf | 2 ++ vars.tf | 6 ++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7c428d6..57609c9 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ data "aws_ssm_parameter" "hook" { module "cloudtrail_to_slack" { source = "fivexl/cloudtrail-to-slack/aws" - version = "2.0.0" + version = "2.0.1" default_slack_hook_url = data.aws_ssm_parameter.hook.value cloudtrail_logs_s3_bucket_name = aws_s3_bucket.cloudtrail.id } @@ -97,7 +97,7 @@ data "aws_ssm_parameter" "prod_hook" { module "cloudtrail_to_slack" { source = "fivexl/cloudtrail-to-slack/aws" - version = "2.0.0" + version = "2.0.1" default_slack_hook_url = data.aws_ssm_parameter.default_hook.value configuration = [ @@ -148,7 +148,7 @@ locals { module "cloudtrail_to_slack" { source = "fivexl/cloudtrail-to-slack/aws" - version = "2.0.0" + version = "2.0.1" default_slack_hook_url = data.aws_ssm_parameter.hook.value cloudtrail_logs_s3_bucket_name = aws_s3_bucket.cloudtrail.id events_to_track = local.events_to_track @@ -177,7 +177,7 @@ data "aws_ssm_parameter" "hook" { module "cloudtrail_to_slack" { source = "fivexl/cloudtrail-to-slack/aws" - version = "2.0.0" + version = "2.0.1" default_slack_hook_url = data.aws_ssm_parameter.hook.value cloudtrail_logs_s3_bucket_name = aws_s3_bucket.cloudtrail.id rules = "'errorCode' in event and event['errorCode'] == 'UnauthorizedOperation','userIdentity.type' in event and event['userIdentity.type'] == 'Root'" @@ -202,7 +202,7 @@ data "aws_ssm_parameter" "hook" { module "cloudtrail_to_slack" { source = "fivexl/cloudtrail-to-slack/aws" - version = "2.0.0" + version = "2.0.1" default_slack_hook_url = data.aws_ssm_parameter.hook.value cloudtrail_logs_s3_bucket_name = aws_s3_bucket.cloudtrail.id rules = join(",", local.cloudtrail_rules) @@ -327,20 +327,23 @@ tested with any other rules. | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 0.12.31 | -| [aws](#requirement\_aws) | >= 3.43 | +| [terraform](#requirement\_terraform) | >= 0.13.1 | +| [aws](#requirement\_aws) | >= 4.8 | +| [external](#requirement\_external) | >= 1.0 | +| [local](#requirement\_local) | >= 1.0 | +| [null](#requirement\_null) | >= 2.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | 3.62.0 | +| [aws](#provider\_aws) | >= 4.8 | ## Modules | Name | Source | Version | |------|--------|---------| -| [lambda](#module\_lambda) | terraform-aws-modules/lambda/aws | 2.25.0 | +| [lambda](#module\_lambda) | terraform-aws-modules/lambda/aws | 3.2.0 | ## Resources @@ -366,11 +369,12 @@ tested with any other rules. | [function\_name](#input\_function\_name) | Lambda function name | `string` | `"fivexl-cloudtrail-to-slack"` | no | | [ignore\_rules](#input\_ignore\_rules) | Comma-separated list of rules to ignore events if you need to suppress something. Will be applied before rules and default\_rules | `string` | `""` | no | | [lambda\_logs\_retention\_in\_days](#input\_lambda\_logs\_retention\_in\_days) | Controls for how long to keep lambda logs. | `number` | `30` | no | +| [lambda\_recreate\_missing\_package](#input\_lambda\_recreate\_missing\_package) | Description: Whether to recreate missing Lambda package if it is missing locally or not | `bool` | `true` | no | | [lambda\_timeout\_seconds](#input\_lambda\_timeout\_seconds) | Controls lambda timeout setting. | `number` | `30` | no | | [rules](#input\_rules) | Comma-separated list of rules to track events if just event name is not enough | `string` | `""` | no | +| [rules\_separator](#input\_rules\_separator) | Custom rules separator. Can be used if there are commas in the rules | `string` | `","` | no | | [tags](#input\_tags) | Tags to attach to resources | `map(string)` | `{}` | no | | [use\_default\_rules](#input\_use\_default\_rules) | Should default rules be used | `bool` | `true` | no | -| [rules\_separator](#input\rules\_separator) | Custom rules separator. Must be defined if there are commas in the rules | `string` | `","` | no | ## Outputs diff --git a/main.tf b/main.tf index 356ab75..ec1447e 100644 --- a/main.tf +++ b/main.tf @@ -11,6 +11,8 @@ module "lambda" { source_path = "${path.module}/src/" + recreate_missing_package = var.lambda_recreate_missing_package + environment_variables = merge( { HOOK_URL = var.default_slack_hook_url diff --git a/vars.tf b/vars.tf index 6b62e4f..3abf713 100644 --- a/vars.tf +++ b/vars.tf @@ -72,6 +72,12 @@ variable "lambda_logs_retention_in_days" { default = 30 } +variable "lambda_recreate_missing_package" { + description = "Description: Whether to recreate missing Lambda package if it is missing locally or not" + type = bool + default = true +} + variable "tags" { description = "Tags to attach to resources" default = {}