GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ibrarmunircoder/VPC-peering-terraform-project: Enabled secure, private cross-region communication between VPCs on AWS (same account) using VPC Peering and Terraform.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
module/vpc
module/vpc
 
 
screenshots
screenshots
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
instance.tf
instance.tf
 
 
locals.tf
locals.tf
 
 
main.tf
main.tf
 
 
peering-connection.tf
peering-connection.tf
 
 
providers.tf
providers.tf
 
 
security-groups.tf
security-groups.tf
 
 
variables.tf
variables.tf
 
 

Repository files navigation

🔒 VPC Peering across regions (Same Account) using Terraform

Enabled secure, private cross-region communication between Primary VPC and Secondary VPC on AWS (same account) using VPC Peering and Terraform.


📌 Project Overview:

This project demonstrates how to enable secure, private, cross-region communication between two isolated VPCs (Primary VPC and Secondary VPC) using VPC Peering and Terraform as Infrastructure as Code (IaC).

A Jumpbox (bastion host) is used for secure administrative access, following AWS best practices by preventing direct SSH access to private EC2 instances.


Live Demo:

Established SSH connection to Jumpbox using SSH agent forwarding

Jumpbox

Connected from Jumpbox to a private EC2 instance (Primary VPC) using the same SSH key

Jumpbox to App

Pinged private EC2 instance in Secondary VPC from private EC2 instance in Primary VPC

Primary to Secondary

Pinged private EC2 instance in Primary VPC from private EC2 instance in Secondary VPC

Secondary to Primary


Architecture Diagram:

architecture diagram


🚀 Key Features:

  • Two VPCs deployed in different AWS regions within the same account
  • Cross-region VPC Peering connection between Primary and Secondary VPC
  • Private EC2 instances deployed in isolated application subnets
  • Route table configuration enabling inter-VPC communication
  • Security group rules controlling service-to-service traffic
  • Jumpbox (bastion host) for secure administrative access
  • Terraform-based infrastructure provisioning (Infrastructure as Code)
  • Reusable Terraform modules for networking components
  • Remote Terraform state management using Amazon S3

🚧 Challenges:

  • Debugged Jumpbox SSH connectivity issues and fixed them by correcting Terraform HCL function path logic
  • Resolved Terraform state conflicts across teams using remote state locking
  • Reduced VPC networking code duplication by designing reusable Terraform modules

🎯 Learning Objectives:

  • Understand why separate VPCs cannot communicate privately by default
  • Learn how to enable private cross-region communication using VPC Peering
  • Gain hands-on experience writing Terraform to provision AWS networking components
  • Implement least-privilege network security for service-to-service communication

👨‍💻 Connect with me:

Ibrar Munir

Github: https://github.com/ibrarmunircoder
LinkedIn: https://www.linkedin.com/in/ibrar-munir-53197a16b
Portfolio: https://ibrarmunir.d3psh89dj43dt6.amplifyapp.com

About

Enabled secure, private cross-region communication between VPCs on AWS (same account) using VPC Peering and Terraform.

Topics

awsaws-vpcec2hcljumpboxprivate-subnetspublic-subnetsremote-statessh-agentssh-agent-forwardingstate-lockingterraformvpcvpc-peering

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.