Skip to content

Commit

Permalink
Make associate public IP dependent on EIP assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhale committed Oct 13, 2019
1 parent c91ce82 commit 0353b26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resource "aws_launch_configuration" "wireguard_launch_config" {
iam_instance_profile = (var.eip_id != "disabled" ? aws_iam_instance_profile.wireguard_profile[0].name : null)
user_data = data.template_file.user_data.rendered
security_groups = local.security_groups_ids
associate_public_ip_address = var.associate_public_ip_address
associate_public_ip_address = (var.eip_id != "disabled" ? true : false)

lifecycle {
create_before_destroy = true
Expand Down
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ variable "eip_id" {
description = "If we detect the default 'disabled' we avoid the EIP switching code in user-data on wg server startup, if an EIP ID is provided the instance will attempt to switch EIP."
}

variable "associate_public_ip_address" {
default = true
description = "get a public address or not, use with eip, but set false if the vpn server sits on a private net behidn elb"
}

variable "additional_security_group_ids" {
type = list(string)
default = [""]
Expand Down

0 comments on commit 0353b26

Please sign in to comment.