Hi.
We have a following situation.
Our target group port is set to 443 but our backend is listening on port 80.
Using AWS console we can easily override a traffic port during instance registration to the target group. However we are unable to override traffic port using aws_autoscaling_attachment.
Whatever we do the autoscaling instances are always set to send traffic to port 443.
Is there any way to tell terraform to override traffic port during aws_autoscaling_attachmen event.
Here is a relevant terraform code:
resource “aws_alb_target_group” “test” { name = “test” port = 443 protocol = “HTTPS” vpc_id = “${var.vpc_id}” deregistration_delay = 80
stickiness {
type = “lb_cookie”
}
health_check {
path = "/heartbeat"
port = "80"
healthy_threshold = 3
unhealthy_threshold = 3
timeout = 5
interval = 50
protocol = "HTTPS"
matcher = "200"
}
}
resource “aws_autoscaling_attachment” “test” {
autoscaling_group_name = “${aws_autoscaling_group_auto_scale.id}”
alb_target_group_arn = “${aws_alb_target_group.test.arn}”
}
Regards.