Skip to content

VPC Peering between Lightsail and VPC

0

I've setup the peering connection between my Lightsail and EC2 VPC but wanted a bit more information on the security group that's needed for port 80. In the documentation its a bit vague. https://aws.amazon.com/blogs/compute/integrating-aws-waf-with-your-amazon-lightsail-instance/. Solution 1: ALB and AWS WAF, Step 3 - If there is any input to this it would be much appreciated.

asked 5 months ago84 views
1 Answer
1

To establish proper communication between your Lightsail instance and resources in your default VPC through VPC peering, you need to configure security groups correctly.

For allowing port 80 traffic between your Lightsail instance and resources in your default VPC:

  1. First, ensure VPC peering is properly enabled by going to the Lightsail console, selecting "Account" from the top navigation menu, choosing the "Advanced" tab, and enabling VPC peering for your region.

  2. For the security group configuration on the default VPC side (where your EC2 or other resources are located):

  • Open the security group associated with your EC2 instance or ALB
  • Add an inbound rule that allows HTTP traffic (port 80)
  • For the source, specify the CIDR range of your Lightsail VPC or the specific private IP address of your Lightsail instance
  1. On the Lightsail side, you'll need to configure the firewall:
  • Go to your Lightsail instance's management page
  • Select the "Networking" tab
  • Add a firewall rule to allow HTTP traffic (port 80) from the CIDR range of your default VPC

Remember that VPC peering in Lightsail can only be established with the default VPC in the same AWS account and region. Also, ensure that the CIDR blocks of the Lightsail VPC and your default VPC don't overlap, as this is a prerequisite for successful VPC peering.

After configuring the security groups and firewall rules, traffic on port 80 should be able to flow between your Lightsail instance and resources in your default VPC through the VPC peering connection.
Sources
peering between a Lightsail instance and my default VPC | AWS re:Post
Community | Connecting Lightsail to AWS Services
Connect Lightsail resources to AWS services using VPC peering - Amazon Lightsail

answered 5 months ago
EXPERT
reviewed 5 months ago
  • Hi Andy, you'll need to update your Lightsail instance firewall to restrict port 80 access to only the CIDR range of your default VPC that's peered with Lightsail. Since you're placing your Lightsail instance behind an ALB, you should only allow traffic originating from the ALB itself. Thanks.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.