Skip to content

Commit

Permalink
feat: target group protocol variable (#38)
Browse files Browse the repository at this point in the history
* feat: target group protocol variable for HTTP/HTTPS healthcheck

* Updated README.md

Co-authored-by: Idikoro Eradiri <ieradiri@soundexchange.com>
Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com>
Co-authored-by: Erik Osterman <erik@cloudposse.com>
  • Loading branch information
4 people authored Jun 13, 2020
1 parent 84acd82 commit ed63eb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Available targets:
| target_group_additional_tags | The additional tags to apply to the target group | map(string) | `<map>` | no |
| target_group_name | The name for the default target group, uses a module label name if left empty | string | `` | no |
| target_group_port | The port for the default target group | number | `80` | no |
| target_group_protocol | The protocol for the default target group HTTP or HTTPS | string | `HTTP` | no |
| target_group_target_type | The type (`instance`, `ip` or `lambda`) of targets that can be registered with the target group | string | `ip` | no |
| vpc_id | VPC ID to associate with ALB | string | - | yes |

Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
| target_group_additional_tags | The additional tags to apply to the target group | map(string) | `<map>` | no |
| target_group_name | The name for the default target group, uses a module label name if left empty | string | `` | no |
| target_group_port | The port for the default target group | number | `80` | no |
| target_group_protocol | The protocol for the default target group HTTP or HTTPS | string | `HTTP` | no |
| target_group_target_type | The type (`instance`, `ip` or `lambda`) of targets that can be registered with the target group | string | `ip` | no |
| vpc_id | VPC ID to associate with ALB | string | - | yes |

Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ module "default_target_group_label" {
resource "aws_lb_target_group" "default" {
name = var.target_group_name == "" ? module.default_target_group_label.id : var.target_group_name
port = var.target_group_port
protocol = "HTTP"
protocol = var.target_group_protocol
vpc_id = var.vpc_id
target_type = var.target_group_target_type
deregistration_delay = var.deregistration_delay

health_check {
protocol = var.target_group_protocol
path = var.health_check_path
timeout = var.health_check_timeout
healthy_threshold = var.health_check_healthy_threshold
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ variable "target_group_port" {
description = "The port for the default target group"
}

variable "target_group_protocol" {
type = string
default = "HTTP"
description = "The protocol for the default target group HTTP or HTTPS"
}

variable "target_group_name" {
type = string
default = ""
Expand Down

0 comments on commit ed63eb3

Please sign in to comment.