1.3.2.1. Pattern Modules
Pattern modules are used to deploy multiple Azure resources. They can be built using resource modules or directly using corresponding resource blocks. While the number of resources they define varies, they are designed to accelerate the implementation of common tasks, deployments, or architectures. Pattern modules allow referencing products from different product lines, provided that their combination offers clear value.
1.3.2.1.1. Use Cases
These modules are suitable for users who wish to easily deploy architectures using WAF best practices (such as Azure Kubernetes Service clusters in production environments). Generally speaking, pattern modules may not be as highly configurable as resource modules, but users should be able to clearly understand the characteristics of the infrastructure deployed by the module.
For example, consider the terraform-aws-multi-az-subnets module maintained by CloudPosse. As the name suggests, the subnets deployed by this module inevitably span multiple availability zones. Its configurability might not be as high as other modules, but if a user simply wants to deploy a set of high-availability subnets spanning multiple zones, this module would be more appropriate.
Take the avm-ptn-aks-production module as another example. Azure Kubernetes Service is an extremely complex product, and the azurerm_kubernetes_cluster resource block has a very intricate structure with high configurability. Users might feel overwhelmed when trying to deploy a highly available AKS cluster using the raw resource. The avm-ptn-aks-production module sacrifices some configurability to provide a configuration that is quite simple to deploy yet fully capable of meeting general production environment requirements.
Additionally, some pattern modules function by combining multiple resource modules into a larger-scale component. For example, avm-ptn-alz-connectivity-hub-and-spoke-vnet implements the Hub-Spoke network architecture on Azure. It integrates a set of virtual networks distributed across different regions into an interconnected cross-regional network. Since we already have resource modules for virtual networks, combining multiple such virtual networks into a larger-scale cross-regional network constitutes a pattern module.
Readers can think of pattern modules as modules tailored for specific scenarios.