Creating Subnets for services in azure
Currently we have six subnet with 5 different types:
-
WEB: web type contains 3 subnet with id 001, 002, 003, where 001 is delegated to Microsoft.Web.serverFarms, 002 is used for apims internal network deployment and 003 is for app gateway deployment. one can check the subnet delegation on this location locals.tf
-
MIDDLE : In this type all the backend web app are deployed and are delegated to Microsoft.Web.serverFarms
-
DATA : On this type all the SQL server are deployed and are delegated to Microsoft.DBforMySQL.flexibleServers
-
PEP : In this type all the private endpoint for app gateway, backend app services are deployed.
-
RUNNER : In this type of subnet our github runner virtul machine are deployed.
Adding new Subnets
To add new subnet one need to add and choose type from above and use respective tfvars and add/update as below with needed subnet cidr on networking block with id,type and prefix .
{
id = "001"
type = "web"
prefix = "10.100.0.0/24"
},
and this terraform code virtual_networks.tf will provision, update or delete the subnet.