diff --git a/README.md b/README.md index ed1f32c8..10cdbe39 100644 --- a/README.md +++ b/README.md @@ -797,6 +797,7 @@ No modules. | [image\_config\_entry\_point](#input\_image\_config\_entry\_point) | The ENTRYPOINT for the docker image | `list(string)` | `[]` | no | | [image\_config\_working\_directory](#input\_image\_config\_working\_directory) | The working directory for the docker image | `string` | `null` | no | | [image\_uri](#input\_image\_uri) | The ECR image URI containing the function's deployment package. | `string` | `null` | no | +| [include\_default\_tag](#input\_include\_default\_tag) | Set to false to not include the default tag in the tags map. | `bool` | `true` | no | | [invoke\_mode](#input\_invoke\_mode) | Invoke mode of the Lambda Function URL. Valid values are BUFFERED (default) and RESPONSE\_STREAM. | `string` | `null` | no | | [ipv6\_allowed\_for\_dual\_stack](#input\_ipv6\_allowed\_for\_dual\_stack) | Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets | `bool` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of KMS key to use by your Lambda Function | `string` | `null` | no | diff --git a/main.tf b/main.tf index 6c3f0940..c67f1bbb 100644 --- a/main.tf +++ b/main.tf @@ -138,7 +138,7 @@ resource "aws_lambda_function" "this" { } tags = merge( - { terraform-aws-modules = "lambda" }, + var.include_default_tag ? { terraform-aws-modules = "lambda" } : {}, var.tags, var.function_tags ) diff --git a/variables.tf b/variables.tf index c4aac208..c71f68ae 100644 --- a/variables.tf +++ b/variables.tf @@ -188,6 +188,12 @@ variable "tags" { default = {} } +variable "include_default_tag" { + description = "Set to false to not include the default tag in the tags map." + type = bool + default = true +} + variable "function_tags" { description = "A map of tags to assign only to the lambda function" type = map(string) diff --git a/wrappers/main.tf b/wrappers/main.tf index d1acc1cf..1092b4d3 100644 --- a/wrappers/main.tf +++ b/wrappers/main.tf @@ -67,6 +67,7 @@ module "wrapper" { image_config_entry_point = try(each.value.image_config_entry_point, var.defaults.image_config_entry_point, []) image_config_working_directory = try(each.value.image_config_working_directory, var.defaults.image_config_working_directory, null) image_uri = try(each.value.image_uri, var.defaults.image_uri, null) + include_default_tag = try(each.value.include_default_tag, var.defaults.include_default_tag, true) invoke_mode = try(each.value.invoke_mode, var.defaults.invoke_mode, null) ipv6_allowed_for_dual_stack = try(each.value.ipv6_allowed_for_dual_stack, var.defaults.ipv6_allowed_for_dual_stack, null) kms_key_arn = try(each.value.kms_key_arn, var.defaults.kms_key_arn, null)