CAB-4856: Apply master-branch kno2-discharge-summary Terraform and check for drift#37
CAB-4856: Apply master-branch kno2-discharge-summary Terraform and check for drift#37
Conversation
WalkthroughAdds an optional variable to override the CloudWatch Logs subscription filter name and updates the Terraform resource to compute the name via coalesce, defaulting to "${var.function_name}_subscription_filter" when no override is provided. No other behavioral changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lambda_function/variables.tf (1)
187-191: Add validation to guard against empty overrides.As written, a caller could pass
"", which Terraform treats as non-null, and we would attempt to create a subscription filter with an empty name—CloudWatch rejects that. Please add avalidationblock so only null or non-empty strings are accepted.You can enforce this with:
variable "subscription_filter_name" { type = string default = null description = "Optional override for the CloudWatch Logs subscription filter name" + validation { + condition = var.subscription_filter_name == null || trim(var.subscription_filter_name) != "" + error_message = "subscription_filter_name must be null or a non-empty string." + } }
Link to Ticket: https://hbuco.atlassian.net/browse/CAB-4856
Summary by CodeRabbit