Create a Lightsail load balancer and attach instances to it - Amazon Lightsail

Create a Lightsail load balancer and attach instances to it

Create a load balancer to add redundancy to your application or to handle more web traffic. After the load balancer is created, you can attach the Lightsail instances that you want to balance. To learn more, see Load balancers

Prerequisites

Before you begin, make sure you've prepared your Lightsail instances for load balancing. For more information, see Configure an instances for load balancing.

Create a load balancer

  1. Sign in to the Lightsail console.

  2. Choose the Networking tab.

  3. Choose Create load balancer.

  4. Confirm the AWS Region where the load balancer will be created, or choose Change region to select a different region.

    Note

    By default, the load balancer will be created with port 80 open to accept HTTP requests. After the load balancer is created, you can create an SSL/TLS certificate and configure HTTPS. For more information, see Create an SSL/TLS certificate for your load balancer

  5. Enter a name for your load balancer.

    Resource names:

    • Must be unique within each AWS Region in your Lightsail account.

    • Must contain 2 to 255 characters.

    • Must start and end with an alphanumeric character or number.

    • Can include alphanumeric characters, numbers, periods, dashes, and underscores.

  6. Choose one of the following options to add tags to your load balancer:

    • Add key-only tags or Edit key-only tags (if tags have already been added). Enter your new tag into the tag key text box, and press Enter. Choose Save when you’re done entering your tags to add them, or choose Cancel to not add them.

      
                Key-only tags in the Lightsail console.
    • Create a key-value tag, then enter a key into the Key text box, and a value into the Value text box. Choose Save when you’re done entering your tags, or choose Cancel to not add them.

      Key-value tags can only be added one at a time before saving. To add more than one key-value tag, repeat the previous steps.

      
                Key-value tags in the Lightsail console.
    Note

    For more information about key-only and key-value tags, see Tags.

  7. Choose Create load balancer.

Attach an instance to your load balancer

After your load balancer is created, Lightsail takes you to the load balancer management page. If you need to find that page again, choose the Networking tab on the Lightsail home page, and then choose the name of your Lightsail load balancer to manage it.

Note

Your Lightsail instance must be running before you can successfully attach it to your load balancer.

  1. On the load balancer management page, choose Target instances.

  2. Choose an instance in the Target instances drop-down menu.

  3. Choose Attach. Attachment can take several minutes.

    Attach another instance to the load balancer by choosing Attach another, and then repeating the preceding steps.

Next steps

After the load balancer is created, and your instances are attached, complete the following next steps to configure your load balancer:

If you experience issues with your load balancer, see Troubleshoot your load balancer