Skip to content

Commit 010aa89

Browse files
feat: Add lambda dead-letter queue variables (#180)
Co-authored-by: chris3ware <[email protected]>
1 parent f14db4a commit 010aa89

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.62.3
3+
rev: v1.76.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.1.0
26+
rev: v4.3.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ See the [functions](https://github.com/terraform-aws-modules/terraform-aws-notif
106106
| <a name="input_iam_role_path"></a> [iam\_role\_path](#input\_iam\_role\_path) | Path of IAM role to use for Lambda Function | `string` | `null` | no |
107107
| <a name="input_iam_role_tags"></a> [iam\_role\_tags](#input\_iam\_role\_tags) | Additional tags for the IAM role | `map(string)` | `{}` | no |
108108
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | ARN of the KMS key used for decrypting slack webhook url | `string` | `""` | no |
109+
| <a name="input_lambda_attach_dead_letter_policy"></a> [lambda\_attach\_dead\_letter\_policy](#input\_lambda\_attach\_dead\_letter\_policy) | Controls whether SNS/SQS dead letter notification policy should be added to IAM role for Lambda Function | `bool` | `false` | no |
110+
| <a name="input_lambda_dead_letter_target_arn"></a> [lambda\_dead\_letter\_target\_arn](#input\_lambda\_dead\_letter\_target\_arn) | The ARN of an SNS topic or SQS queue to notify when an invocation fails. | `string` | `null` | no |
109111
| <a name="input_lambda_description"></a> [lambda\_description](#input\_lambda\_description) | The description of the Lambda function | `string` | `null` | no |
110112
| <a name="input_lambda_function_ephemeral_storage_size"></a> [lambda\_function\_ephemeral\_storage\_size](#input\_lambda\_function\_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 |
111113
| <a name="input_lambda_function_name"></a> [lambda\_function\_name](#input\_lambda\_function\_name) | The name of the Lambda function to create | `string` | `"notify_slack"` | no |

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ module "lambda" {
118118
use_existing_cloudwatch_log_group = true
119119
attach_network_policy = var.lambda_function_vpc_subnet_ids != null
120120

121+
dead_letter_target_arn = var.lambda_dead_letter_target_arn
122+
attach_dead_letter_policy = var.lambda_attach_dead_letter_policy
123+
121124
allowed_triggers = {
122125
AllowExecutionFromSNS = {
123126
principal = "sns.amazonaws.com"

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ variable "lambda_source_path" {
3434
default = null
3535
}
3636

37+
variable "lambda_dead_letter_target_arn" {
38+
description = "The ARN of an SNS topic or SQS queue to notify when an invocation fails."
39+
type = string
40+
default = null
41+
}
42+
43+
variable "lambda_attach_dead_letter_policy" {
44+
description = "Controls whether SNS/SQS dead letter notification policy should be added to IAM role for Lambda Function"
45+
type = bool
46+
default = false
47+
}
48+
3749
variable "sns_topic_name" {
3850
description = "The name of the SNS topic to create"
3951
type = string

0 commit comments

Comments
 (0)