Skip to content

Commit

Permalink
Adding default target group port to accomodate for a TG with a port o…
Browse files Browse the repository at this point in the history
…ther than 80 (#19)

* Adding default target group port to accomodate for a TG with a port other than 80

* Rebuilding README
  • Loading branch information
jamengual authored and aknysh committed Jun 21, 2019
1 parent 50327a1 commit 1db30b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Available targets:
| stage | Stage, e.g. `prod`, `staging`, `dev`, or `test` | string | - | yes |
| subnet_ids | A list of subnet IDs to associate with ALB | list | - | yes |
| tags | Additional tags (e.g. `map(`BusinessUnit`,`XYZ`) | map | `<map>` | no |
| target_group_port | The port for the default target group | string | `80` | no |
| vpc_id | VPC ID to associate with ALB | string | - | yes |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
| stage | Stage, e.g. `prod`, `staging`, `dev`, or `test` | string | - | yes |
| subnet_ids | A list of subnet IDs to associate with ALB | list | - | yes |
| tags | Additional tags (e.g. `map(`BusinessUnit`,`XYZ`) | map | `<map>` | no |
| target_group_port | The port for the default target group | string | `80` | no |
| vpc_id | VPC ID to associate with ALB | string | - | yes |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module "default_target_group_label" {

resource "aws_lb_target_group" "default" {
name = "${module.default_target_group_label.id}"
port = "80"
port = "${var.target_group_port}"
protocol = "HTTP"
vpc_id = "${var.vpc_id}"
target_type = "ip"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,8 @@ variable "alb_access_logs_s3_bucket_force_destroy" {
description = "A boolean that indicates all objects should be deleted from the ALB access logs S3 bucket so that the bucket can be destroyed without error"
default = false
}

variable "target_group_port" {
description = "The port for the default target group"
default = "80"
}

0 comments on commit 1db30b9

Please sign in to comment.