From f0e409b23abeaff83051b19e03eff8879032e5e0 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Date: Thu, 17 Jul 2025 12:44:05 +0100 Subject: [PATCH] feat: to allow support for prevent_destroy lifecycle option --- main.tf | 1 + variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/main.tf b/main.tf index f23b561..45a0b42 100644 --- a/main.tf +++ b/main.tf @@ -94,6 +94,7 @@ resource "aws_lb" "this" { ignore_changes = [ tags["elasticbeanstalk:shared-elb-environment-count"] ] + prevent_destroy = var.enable_alb_prevent_destroy } } diff --git a/variables.tf b/variables.tf index 9b3c725..dccb40d 100644 --- a/variables.tf +++ b/variables.tf @@ -188,6 +188,12 @@ variable "timeouts" { default = {} } +variable "enable_alb_prevent_destroy" { + description = "Whether to add lifecycle.prevent_destroy to the ALB resource" + type = bool + default = false +} + ################################################################################ # Listener(s) ################################################################################