This repository contains a set of Terraform child modules for provisioning various resources. The modules are designed to be used together in a root module to create a complete infrastructure deployment.
The rgroup-RandomID
module provisions 1 resource group called RandomID-RG. The module returns the name of the resource group to the root module.
The network-RandomID
module provisions 1 virtual network called RandomID-VNET and 1 subnet called RandomID-SUBNET in the RandomID-RG resource group. It also adds a network security group with 4 inbound access rules for ports 22, 3389, 5985, and 80. The network security group is associated with the subnet. This module returns the names of the virtual network and the subnet to the root module.
The common-RandomID
module provisions 1 log analytics workspace, 1 recovery services vault, and 1 standard storage account with LRS redundancy. The storage account created must be different from the one used as the Terraform backend. This module returns the names of the three resources to the root module.
The vmlinux-RandomID
module provisions 3 CentOS 8.2 Linux VMs with public IP addresses across 3 availability zones. Each VM uses the storage account blob container created above for VM boot diagnostics. The VMs have unique DNS labels assigned and have Network Watcher and Azure Monitor extensions installed. The hostnames, domain names, private IP addresses, and public IP addresses of the VMs are returned to the root module.
The vmwindows-RandomID
module provisions 1 Windows Server 2016 VM with a public IP address in an availability set. The VM has the Antimalware extension installed and uses the storage account blob container created above for VM boot diagnostics. The VM has a unique DNS label assigned. The hostname, domain name, private IP address, and public IP address of the VM are returned to the root module.
The datadisk-RandomID
module provisions 4 x 10GB disks and attaches them to the 4 VMs.
The loadbalancer-RandomID
module provisions 1 public-facing basic load balancer with all 3 Linux VMs behind it. The name of the load balancer is returned to the root module.
The database-RandomID
module provisions 1 Azure DB for PostgreSQL Single Server instance. The name of the DB instance is returned to the root module.
The assignment1-RandomID
root module defines all child modules and prints the outputs received from child modules on a successful deployment.
TODO:
- common-n01537188
- database-n01537188
- datadisk-n01537188
- loadbalancer-n01537188
- network-n01537188
- rgroup-n01537188
- vmlinux-n01537188
- vmwindows-n01537188
Get number of resources to be created
terraform plan -detailed-exitcode