0

I have updated my question again. Below things i have done with AWS ALB.

  1. Created Target group which is IP based to registered one instance with Port 80. I have created ALB listener with 443 IF Host header is zzzzz.example.com Then Forward to created Targetgroup. As well ALB Listener 80 THEN Redirect tohttps://#{host}:443/#{path}?#{query} Status code:HTTP_301. Its working fine. But its target group still unhealthy.

  2. Created Target group which is Instance based to registered another one instance with Port 8443. I have tried to add in same Listener 443 IF Host header is yyyyy.example.com Then Forward to created Targetgroup. But its not worked as expected. its too unhealthy.

Where i'm wrong? How can i solve this one? Is my case logically right?

Latchu
  • 61
  • 9
  • The question is not very clear. You already have the ALB listening at 443 and forwarding to the Management Application / Web portal at 8443 Now you can start different instances (clean isnstances without any application installed on it ) What do you want to achieve with these new instances – qkhanhpro Dec 03 '20 at 09:01
  • Sorry for not clearing. Yes i already configured ALB listening at 443 and forwarding to my webportal at Port 804. Hereafter i have to do same ALB listening at 443 and forwarding to upcoming instances at 8443. I hope you can understand – Latchu Dec 03 '20 at 09:13
  • What is the end result you would like to achieve? I believe that you can reach these instances at 443 or 8443 directly unless they are in the private subnet? do you have any pattern for assigning A records in Route53? – qkhanhpro Dec 03 '20 at 09:31
  • We have used some boto3 script to launching new instances as well assigning A records in Route53. – Latchu Dec 03 '20 at 09:33
  • @qkhanhpro, Kindly look at my updated question and let me know where i'm wrong? – Latchu Dec 04 '20 at 08:50

1 Answers1

0

You can use AWS SDK to create a target group with the IP of new instance to forward 8443 port to 443 port and then attach it to the load balancer.

Here's how : How to create and attach a ELB properly in Boto3

Atul Sharma
  • 9,397
  • 10
  • 38
  • 65
  • I have checked above what you suggested me. Its clearly about to create target group for known instances. Right? .My case that instances will launch by creating in my webportal. So can we point this for newly launching instances? – Latchu Dec 03 '20 at 09:20
  • when you create the instance you must have the instance id returned from the API, you can use that instance id while creating the target group – Atul Sharma Dec 03 '20 at 09:32
  • 1
    Yes, I understood. I need to make script to fetch instance id and put in target group. – Latchu Dec 03 '20 at 09:35