As the Service Provider, you want to enable your NLB to be shared with other VPCs. You Can whitelist AWS accounts that can create Endpoints in their VPCs if they explicitly know the name of your new Endpoint Service. if with the Whitelisting, you also have the ability to require explicit acknowledgement from the service provider side, before their PrivateLink becomes active.
In the AWS Management Console choose Services then select VPC.
From the menu on the left, Scroll down and select Peering Connections. Peering Connections allow us to connect two VPCs, even in other AWS Accounts. We will focus on local region, but you can also create cross-region VPC peering.
In the main pane, click the Create Peering Connection button.
On the Create Peering Connection page: Give your connection a Peering connection name tag, Select your NP1-*your-stack* VPC for VPC (Requester), keep Account and Region at defaults, and Select NP2-*your-stack* VPC for VPC (Accepter).
You will see the CIDR ranges for each listed out. Peering will not succeed if there is an overlap IP CIDRs between the two VPC.
Click the Create Peering Connection button at the bottom of the page.
You should get a Success Page, click ok.
In the AWS Management Console choose Services then select VPC.
From the menu on the left, Scroll down and select Route Tables. Route Tables are associated with Subnets. In this case We are interested in the NP1 Public Subnets and the route table associated with those two subnets.
In the main pane, type in a filter NP1 and check the box next to the NP1-Stack_Name-Public Route Table line item. Be sure to select the Public route table for the NP1 VPC
From the Actions button, select Edit Routes. We are going to add a route to just the two NP2 Public Subnets, which can be summarized as 10.17.0.0/21 (10.17.0.0/22 + 10.17.4.0/22)
From the Edit Routes pane, Click the Add Route button and add the following entry:
Destination: 10.17.0.0/21
Target: *Select Peering Connection and from the drop down list select the peering connection (should only be one in the lab)*
Click Save Routes in the bottom right.
In the AWS Management Console choose Services then select VPC.
From the menu on the left, Scroll down and select Route Tables. Route Tables are associated with Subnets. In this case We are interested in the NP2 Public Subnets and the route table associated with those two subnets.
In the main pane, type in a filter NP2 and check the box next to the NP2-Stack_Name-Public Route Table line item. Be sure to select the Public route table for the NP1 VPC
From the Actions button, select Edit Routes. We are going to add a route to just the two NP1 Public Subnets, which can be summarized as 10.16.0.0/21 (10.16.0.0/22 + 10.16.4.0/22)
From the Edit Routes pane, Click the Add Route button and add the following entry:
Destination: 10.16.0.0/21
Target: *Select Peering Connection and from the drop down list select the peering connection (should only be one in the lab)*
Click Save Routes in the bottom right.