Open topic with navigation

# Adding a Listener for Ports 443, 32081, and 32080 to the ALB

This action will connect the ALB to the specified port through the target group. Then, incoming requests to the ALB on the port will be directed to the node instances.

To add a listener for port 443 using the web UI:

1. Using the Find Services search tool, locate and browse to the EC2 Dashboard.
2. In the left navigation panel, under Load Balancing, click Load Balancers.
3. From the list of load balancers, select your previously-created Application Load Balancer (ALB).

1. On the Listeners tab, click Add Listener and set values for the following:
   1. Protocol: port: Change to HTTPS and 443.
   2. Default action(s): Select the action Forward to... then choose your target group for port 443.
   3. Default SSL certificate: Select the SSL certificate you have created previously.
2. Click Save.
3. Repeat Steps 1-5 for port 32081.
4. Repeat Steps 1-5 for port 32080.

To add a listener for port 443, 32080, and 32081 using the CLI:

1. Run the following command:

       # aws elbv2 create-listener \
       --load-balancer-arn <ALB ARN> \
       --protocol HTTPS --port 443 \
       --certificates CertificateArn=<Certificate ARN> \
       --default-actionsType=forward,TargetGroupArn=<Target group 443 ARN>

Where:

`<ALB ARN>:`Use the ALB ARN recorded in the AWS worksheet.

`<Certificate ARN>:` Use the certifcate ARN recorded in the AWS worksheet.

`<Target group 443 ARN>:` is the target group for port 443 ARN recorded in the AWS worksheet.

Example input and output:

    # aws elbv2 create-listener \
    --load-balancer-arn arn:aws:elasticloadbalancing:eu-central-1:115370811111:loadbalancer/app/srgdemo-alb/8718b24107ef591b \
    --protocol HTTPS --port 443 --certificates CertificateArn=arn:aws:acm:eu-central-1:115370811111:certificate/691ec232-98ff-45ed-8e69-1d15c0447538 \
    --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:eu-central-1:115370811111:targetgroup/srgdemo-443-tg/a096cb67c2f9144dv

    {
       "Listeners":[
          {
             "ListenerArn":"arn:aws:elasticloadbalancing:eu-central-1:115370811111:listener/app/srgdemo-alb/8718b24107ef591b/66915d0da2adb8a9",
             "LoadBalancerArn":"arn:aws:elasticloadbalancing:eu-central-1:115370811111:loadbalancer/app/srgdemo-alb/8718b24107ef591b",
             "Port":443,
             "Protocol":"HTTPS",
             "Certificates":[
                {
                   "CertificateArn":"arn:aws:acm:eu-central-1:115370811111:certificate/691ec232-98ff-45ed-8e69-1d15c0447538"
                }
             ],
             "SslPolicy":"ELBSecurityPolicy-2016-08",
             "DefaultActions":[
                {
                   "Type":"forward",
                   "TargetGroupArn":"arn:aws:elasticloadbalancing:eu-central-1:115370811111:targetgroup/srgdemo-443-tg/6d30f1c7be588bb6",
                   "ForwardConfig":{
                      "TargetGroups":[
                         {
                            "TargetGroupArn":"arn:aws:elasticloadbalancing:eu-central-1:115370811111:targetgroup/srgdemo-443-tg/6d30f1c7be588bb6",
                            "Weight":1
                         }
                      ],
                      "TargetGroupStickinessConfig":{
                         "Enabled":false
                      }
                   }
                }
             ]
          }
       ]
    }

1. Repeat the command for port 32081 for the schema registry.
2. Repeat the command for port 32080 for Fusion.

Next Step: Completing the Database and Kafka Scheduler Setups - AWS