VPC Peering in AWS and GCP



The steps to do VPC peering in AWS and GCP are quite similar. You need to have these info:

In AWS

  • Account ID
  • Source and Target VPC ID
  • Permission
In GCP
  • Project ID
  • Source and Target VPC name
  • Permission

The below steps assume that the VPC peering are done on 2 different accounts (on AWS) or projects (on GCP) and both source and target VPC have been created prior.

How to do VPC peering in AWS:
You'll do configure the VPC peering in the source account first then followed with target account with similar steps.

1. Login to the source account.
2. Go to VPC > Peering Connections > Create Peering Connections.


3. Fill up the required information and click "Create Peering Connection" button. You'll see the review page. If the information is correct, proceed with the creation. 
4. You'll see your newly created peering status is "Pending Acceptance". Now login to the target account to accept the peering.
5. In the target account, go to VPC > Peering Connections. 
6. You'll see there's pending peering connection request. Choose on that entry and click button "Actions" > Accept Request.
7. The status should turn Active now.

*You may need to update the route table and security group entries if it's necessary.


How to do VPC peering in GCP:
You'll configure the VPC peering in the source project first then move on to the target project with the similar steps. 

  1. Go to the first/source project
  2. Go to VPC Networking > VPC Network Peering
  3. Click "Create Connection" > Continue
  4. Fill up the info and click button Create



You'll see the status is "Inactive" as you need to do the same steps on Target project.




You'll see the status is "Active" now.


You can confirm the peering by running this command in Cloud Shell:

gcloud compute routes list --project <target_project_id>

You should see entry with name starts with "peering-route" in the result.


No comments:

Post a Comment

Things I Do to Stay Relevant in the Tech/Cybersecurity Industry

 I have been working in tech industry for more than 10 years and the past few years in Cybersecurity space. It's been a great journey so...