> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring an AWS Load Balancer with SSL in Front of Aviatrix Controller

> The Aviatrix Controller supports adding an SSL certificate. However, sometimes you may prefer to put an AWS Load Balancer (ALB) in front of the Controller.

The Aviatrix Controller supports adding an SSL certificate. However, sometimes
you may prefer to put an AWS Load Balancer (ALB) in front of the Controller.

<img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-ssl-lb.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=24fb652cdc9f4ff6e8d26e7e1477344f" alt="aws ssl lb" width="743" height="353" data-path="images/guides/controlplane/aws-ssl-lb.png" />

Follow these steps to place the Aviatrix Controller behind an AWS ALB:

1. Log into your AWS console.

2. Go to EC2 > Load Balancers in the region where your Aviatrix Controller is
   running.

3. Click **Create load balancer**.

4. Click **Create** under Application Load Balancer.

   <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-1.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=ff9b42712ca24c0737fef018d6d06010" alt="500" width="1836" height="1596" data-path="images/guides/controlplane/aws-lb-1.png" />

5. On the Create Application Load Balancer page, under Basic configuration,
   enter a name for the load balancer.

6. Also under Basic Configuration, select **Internet-Facing** for the Scheme.

   <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-2.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=f2f5b7abe00c6d93c12c100e54375858" alt="500" width="1556" height="1402" data-path="images/guides/controlplane/aws-lb-2.png" />

7. Under Network mapping, select at least two Availability Zones and one subnet
   per zone.

8. Under Security groups, select the appropriate security group from the
   Security groups drop-down. This security group should allow traffic on port
   443 from your desired source network(s). A default security group may already
   be selected.

   <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-3.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=bfb57fd2953521433c041afea3789c36" alt="500" width="1536" height="840" data-path="images/guides/controlplane/aws-lb-3.png" />

9. Under Listeners and routing, select **HTTPS** from the Protocol list.

10. Select a target group from the Default action field.

11. (optional) If needed, click **Create target group** under the **Default
    action** field. This opens the EC2 > Target groups > Create target group
    Console page in a new web browser tab.

    <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-3a.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=7ab6e113d0588afd7b7eb06cf2ebe585" alt="500" width="2062" height="670" data-path="images/guides/controlplane/aws-lb-3a.png" />

    On the Specify group details page:

    1. Select the **Instances** target type.
    2. Enter a target group name.
    3. Select the HTTPS Protocol and port 443.
    4. Select the VPC where the Controller resides (normally named
       aviatrix-mgt-vpc).
    5. Under Health checks, select the HTTPS Protocol and the default Path of
       '/'.
    6. Click **Next** to register the target group.

12. On the Create Application Load Balancer page, under Secure listener
    settings, select **From ACM** from the Default SSL/TLS Certificate drop-down
    and select your certificate. If necessary you can
    [request a new certificate](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html).

    <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-5.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=7fd8b0029fd4f246f96d8392d4a6b742" alt="500" width="1886" height="680" data-path="images/guides/controlplane/aws-lb-5.png" />

13. Review and create the load balancer.

14. Collect the DNS name from the load balancer.

    <img src="https://mintcdn.com/aviatrix-14b37c43/Y73dDPMr0NB7yfrH/images/guides/controlplane/aws-lb-6.png?fit=max&auto=format&n=Y73dDPMr0NB7yfrH&q=85&s=d95a33eab3dc60c3a80afe783009b0b7" alt="500" width="2194" height="1340" data-path="images/guides/controlplane/aws-lb-6.png" />

15. Create a DNS CNAME record that points your desired name to the load
    balancer's DNS name.

    <Note>
      The DNS CNAME record must match the name used in the SSL certificate or
      you will receive a warning.
    </Note>

16. Ensure that your Controller security groups have an inbound allow policy for
    port 443 for the VPC CIDR, so that the load balancer can talk to the
    Controller.

<Note>
  If you have enabled HA for your Aviatrix Controller, you can point your auto
  scaling group to the target group of your load balancer in the event of a
  failover. The Max value should always be 1. Having more than one active
  Controller for any given set of services is not supported if deployed behind a
  load balancer.
</Note>
