This project demonstrates the setup of VNet peering between two Azure Virtual Networks (VNets) using Terraform. VNet peering allows for seamless connectivity between VNets, enabling resources in either VNet to communicate with each other directly.
The workspace contains several key files essential for the Terraform configuration:
main.tf
: Contains the core Terraform configuration for creating resource groups, VNets, subnets, and peering connections.variables.tf
: Defines variables used in the Terraform configurations.terraform.tfvars
: Specifies values for the defined variables.provider.tf
: Configures the Azure provider for Terraform.README.md
: Provides documentation on the project's purpose, architecture, and setup instructions.
A single resource group named peering-rg
is created to contain all the resources for this project.
Two VNets are created in different Azure regions:
- VNet-A in the East US region with an address space of
10.5.0.0/16
and a default subnet of10.5.0.0/24
. - VNet-B in the Central US region with an address space of
10.15.0.0/16
and a default subnet of10.15.0.0/24
.
Peering connections are established from VNet-A to VNet-B and vice versa. The configuration allows forwarded traffic but does not allow gateway transit.
- Ensure you have Terraform and Azure CLI installed and configured.
- Clone the repository containing the workspace.
- Navigate to the project directory and initialize Terraform with
terraform init
. - Apply the Terraform configuration with
terraform apply
.
Discuss any Network Security Groups (NSGs) applied to the subnets or the VNets, including the allowed and denied traffic rules.
- Utilize Azure Monitor to keep track of the network traffic.
- Use Azure Network Watcher for troubleshooting connectivity issues.
This project sets up VNet peering within Azure using Terraform, ensuring seamless connectivity between different VNets while maintaining high security and performance standards.