Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #211 from andrew-womeldorf/issue/210-load-balancers
Browse files Browse the repository at this point in the history
Ignore changes to load balancers in vault-cluster ASG
  • Loading branch information
brikis98 authored Sep 13, 2020
2 parents f67f99a + 14c5a78 commit 2995dc8
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions modules/vault-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,21 @@ resource "aws_autoscaling_group" "autoscaling_group" {
}


# aws_launch_configuration.launch_configuration in this module sets create_before_destroy to true, which means
# everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors
# when you try to do a terraform destroy.
lifecycle {
# aws_launch_configuration.launch_configuration in this module sets create_before_destroy to true, which means
# everything it depends on, including this resource, must set it as well, or you'll get cyclic dependency errors
# when you try to do a terraform destroy.
create_before_destroy = true

# 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 vault-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]
}
}

Expand Down Expand Up @@ -343,9 +353,9 @@ data "aws_iam_policy_document" "vault_dynamo" {
}

resource "aws_iam_role_policy" "vault_dynamo" {
count = var.enable_dynamo_backend ? 1 : 0
name = "vault_dynamo"
role = aws_iam_role.instance_role.id
count = var.enable_dynamo_backend ? 1 : 0
name = "vault_dynamo"
role = aws_iam_role.instance_role.id
policy = element(
concat(data.aws_iam_policy_document.vault_dynamo.*.json, [""]),
0,
Expand Down

0 comments on commit 2995dc8

Please sign in to comment.