diff --git a/modules/nomad-cluster/main.tf b/modules/nomad-cluster/main.tf index 28e22a0..64453a6 100644 --- a/modules/nomad-cluster/main.tf +++ b/modules/nomad-cluster/main.tf @@ -49,6 +49,18 @@ resource "aws_autoscaling_group" "autoscaling_group" { propagate_at_launch = tag.value["propagate_at_launch"] } } + + lifecycle { + # As of AWS Provider 3.x, inline load_balancers and target_group_arns + # in an aws_autoscaling_group take precedence over attachment resources. + # Since the consul-cluster module does not define any Load Balancers, + # it's safe to assume that we will always want to favor an attachment + # over these inline properties. + # + # For further discussion and links to relevant documentation, see + # https://github.com/hashicorp/terraform-aws-vault/issues/210 + ignore_changes = [load_balancers, target_group_arns] + } } # ---------------------------------------------------------------------------------------------------------------------