Terraform modules make infrastructure reusable. Here’s how to build production-ready Azure modules.
Module Structure
modules/
└── azure-webapp/
├── main.tf
├── variables.tf
├── outputs.tf
└── README.mdVariables
variable "name" {
description = "Web app name"
type = string
}
variable "sku" {
description = "App Service SKU"
type = string
default = "B1"
}Usage
module "webapp" {
source = "./modules/azure-webapp"
name = "myapp"
sku = "P1v2"
}
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.