Creating subnets
A subnet in Azure is a key networking component that segments a virtual network into smaller, manageable sections. It allows us to define distinct routing and security boundaries within the network, providing fine-grained control over traffic flow and access to resources. Each subnet can have its own routing policies, network security groups (NSGs), and other configurations tailored to specific application needs.
In this recipe, we will walk through the steps to define and provision subnets in Azure, ensuring proper network segmentation and security for your resources.
To create subnets, you have to associate each subnet with its parent VNet by specifying the virtual_network_name parameter:
- Update the
group_vars/eu.ymlandgroup_vars/us.ymlfiles with the subnets’ data, as shown here for the EU region (check the repository for the US example):root@cookbook-lab:~/cookbook-lab/chapters/ch09# vi group_vars/eu.yml ... ...