Skip to content

Commit

Permalink
Merge pull request #14 from devops-workflow/target-type
Browse files Browse the repository at this point in the history
Add option to set target-type for target groups
  • Loading branch information
snemetz authored Jun 7, 2018
2 parents 6c9b78d + 91e6400 commit c014a4d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
19 changes: 10 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ resource "aws_lb_target_group" "application-http" {
list(element(compact(split(",",local.instance_http_ports)), count.index))
)}"

port = "${element(compact(split(",",local.instance_http_ports)), count.index)}"
protocol = "HTTP"
vpc_id = "${var.vpc_id}"
port = "${element(compact(split(",",local.instance_http_ports)), count.index)}"
protocol = "HTTP"
target_type = "${var.target_type}"
vpc_id = "${var.vpc_id}"

#deregistration_delay = "${}"
#target_type = "${}"
health_check {
interval = "${var.health_check_interval}"
path = "${var.health_check_path}"
Expand Down Expand Up @@ -300,12 +300,12 @@ resource "aws_lb_target_group" "application-https" {
list(element(compact(split(",",local.instance_https_ports)), count.index))
)}"

port = "${element(compact(split(",",local.instance_https_ports)), count.index)}"
protocol = "HTTP"
vpc_id = "${var.vpc_id}"
port = "${element(compact(split(",",local.instance_https_ports)), count.index)}"
protocol = "HTTP"
target_type = "${var.target_type}"
vpc_id = "${var.vpc_id}"

#deregistration_delay = "${}"
#target_type = "${}"
health_check {
interval = "${var.health_check_interval}"
path = "${var.health_check_path}"
Expand Down Expand Up @@ -372,10 +372,10 @@ resource "aws_lb_target_group" "network" {
protocol = "TCP"
stickiness = []
tags = "${module.label.tags}"
target_type = "${var.target_type}"
vpc_id = "${var.vpc_id}"

#deregistration_delay = "${}"
#target_type = "${}"
lifecycle {
create_before_destroy = true
}
Expand Down Expand Up @@ -462,3 +462,4 @@ resource "aws_lb_listener_rule" "this" {
}
}
*/

5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ variable "lb_tcp_ports" {
default = ""
}

variable "target_type" {
description = "Type for targets for target group. Can be: instance or ip"
default = "instance"
}

///
/// Health Checks
///
Expand Down

0 comments on commit c014a4d

Please sign in to comment.