- Lab
- A Cloud Guru
Create and Peer an Application Virtual Network
Welcome to the Create and Peer an Application Virtual Network lab. In this lab, we will cover three objectives: 1. Create an Application VNet using the VNet module 2. Peer the Application VNet with the Hub VNet 3. Confirm traffic flow between VNets By the end of this lab, you will have successfully created an Azure virtual network using the VNet module from the public registry and peered the virtual network with another virtual network in the same subscription.
Path Info
Table of Contents
-
Challenge
Create an Application VNet using the VNet module
In this objective, you will create an application virtual network using the VNet module and the resource group provided by the lab. The network should use the
10.42.0.0/16
address space, and the web and app subnets should both use 24-bit subnets from that address space.- Log into the Azure CLI using the lab credentials
- Retrieve the name of the resource group used for this lab:
az group list --query [].name
- Create a Terraform configuration using the
azurerm
provider:provider.tf
provider "azurerm" { features {} skip_provider_registration = true }
- Configure the lab provided resource group as a data source:
main.tf
data "azurerm_resource_group" "main" { name = var.resource_group_name }
- Use the VNet module to create a virtual network with two subnets. Create and add additional input variables and Terraform files as needed.
- Deploy the virtual network to Azure using Terraform
-
Challenge
Peer the Application VNet with the shared VNet
In this objective, you will peer the application virtual network you created in the previous objective with the existing Hub virtual network generated by the lab. The peering should not provide gateway transit or forwarded traffic.
- Retrieve the name of the Hub virtual network:
az network vnet list --query [].name
- Add a
azurerm_virtual_network
data source to your configuration - Create
azurerm_virtual_network_peering
resources for each direction of the peering connection - Apply the updated configuration to your environment
-
Challenge
Confirm traffic flow between VNets
- Check on the peering connections from the command line:
az network vnet peering list --resource-group RESOURCE_GROUP_NAME --vnet-name HUB_VNET_NAME az network vnet peering list --resource-group RESOURCE_GROUP_NAME --vnet-name APP_VNET_NAME
- Log into the Azure portal and visually confirm peering connectivity
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.