Raj Lal
Raj Lal

Reputation: 43

How do I use a EC2 load balancer with AWS Lightsail instance?

I am trying to install a wildcard certificate in my AWS lightsail instance load balancer. But the Lightsail instance does not allow wildcard certificate. Although EC2 loadbalancer allows wildcard certificate. Can anyone explain how i can use EC2 Load balancer with a Lightsail instance?

I tried this step by Mr. Colin. Wildcard SSL on Lightsail Load Balancer

But I dont see my instance there can anyone give a little bit more detail

Upvotes: 4

Views: 2579

Answers (2)

Hendy Irawan
Hendy Irawan

Reputation: 21424

Unfortunately, based on my research, AWS Lightsail cannot be accessed directly using private IP addresses with regular/non-Lightsail services, because Lightsail does not use your regular VPCs.

This includes and especially affects EC2 (Application/Network) Load Balancer.

To use Lightsail with other AWS services, you can set up VPC Peering. For how much, you may ask?

There is no charge for setting up or running a VPC peering connection. Data transferred across peering connections is charged at $0.01/GB for send and receive, regardless of the Availability Zones involved.

So, depending on your priorities, your options include:

  1. Switch to EC2, which will give you greater flexibility and (depending on instance type) guaranteed performance. Lightsail instances use burstable instances, comparable to EC2's t3 instances.
  2. Install nginx inside Lightsail as reverse proxy on port 80 and/or 443, therefore expanding your options to use it directly or using an external CDN/Load balancer such as CloudFlare.
  3. Use Lightsail Load Balancer, and not use wildcard certificate.

Upvotes: 2

Binh Nguyen
Binh Nguyen

Reputation: 2157

From load balancer's target group creation, there is an option which uses IP address instead of Instance.

So if you did mistakenly create the Instance option, you need to:

1) Create another target group under IP address option.

2) Add your LightSail instance's private IP address into the new target group.

3) Ensure your LightSail security group to allow health check from load balancer.

Upvotes: 2

Related Questions