Skip to content

Instantly share code, notes, and snippets.

@AndrewBestbier
Last active July 15, 2020 11:43
Show Gist options
  • Select an option

  • Save AndrewBestbier/48eaf7cab63ff369deb9758434cd4c11 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewBestbier/48eaf7cab63ff369deb9758434cd4c11 to your computer and use it in GitHub Desktop.
resource "aws_lb_target_group" "target_group" {
name = "target-group"
port = 80
protocol = "HTTP"
target_type = "ip"
vpc_id = "${aws_default_vpc.default_vpc.id}" # Referencing the default VPC
health_check {
matcher = "200,301,302"
path = "/"
}
}
resource "aws_lb_listener" "listener" {
load_balancer_arn = "${aws_alb.application_load_balancer.arn}" # Referencing our load balancer
port = "80"
protocol = "HTTP"
default_action {
type = "forward"
target_group_arn = "${aws_lb_target_group.target_group.arn}" # Referencing our tagrte group
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment