# https://github.com/Azure/terraform-azurerm-compute | |
provider "azurerm" { | |
features {} | |
} | |
resource "azurerm_resource_group" "example" { | |
name = "example-resources" | |
location = "West Europe" | |
} | |
module "linuxservers" { | |
source = "Azure/compute/azurerm" | |
resource_group_name = azurerm_resource_group.example.name | |
vm_os_simple = "UbuntuServer" | |
public_ip_dns = ["linsimplevmips"] // change to a unique name per datacenter region | |
vnet_subnet_id = module.network.vnet_subnets[0] | |
depends_on = [azurerm_resource_group.example] | |
} | |
module "windowsservers" { | |
source = "Azure/compute/azurerm" | |
resource_group_name = azurerm_resource_group.example.name | |
is_windows_image = true | |
vm_hostname = "mywinvm" // line can be removed if only one VM module per resource group | |
admin_password = "ComplxP@ssw0rd!" | |
vm_os_simple = "WindowsServer" | |
public_ip_dns = ["winsimplevmips"] // change to a unique name per datacenter region | |
vnet_subnet_id = module.network.vnet_subnets[0] | |
depends_on = [azurerm_resource_group.example] | |
} | |
module "network" { | |
source = "Azure/network/azurerm" | |
resource_group_name = azurerm_resource_group.example.name | |
subnet_prefixes = ["10.0.1.0/24"] | |
subnet_names = ["subnet1"] | |
depends_on = [azurerm_resource_group.example] | |
} | |
output "linux_vm_public_name" { | |
value = module.linuxservers.public_ip_dns_name | |
} | |
output "windows_vm_public_name" { | |
value = module.windowsservers.public_ip_dns_name | |
} |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND