Terraform: 101-vm-simple-windows-visualstudio2019


Kiran Patnayakuni   |   Co-authors:  Anusha DokulaVeeresh Setty

Windows Server 2016 with Visual Studio 2019

Description

This is a conversion of ARM template 101-vm-simple-windows-visualstudio2019  from the repository azure\azure-quickstart-templates  to Terraform configuration.

This configuration deploys a Windows Server Datacenter 2016 VM with Visual Studio 2019 Community Edition, using the latest patched version. This will deploy a Standard_D2_v2 size VM in the resource group location and return the admin user name, and it will deploy the following resources…

Syntax

# To initialize the configuration directory
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform init 
​
# To check the execution plan
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform plan
​
# To deploy the configuration
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform apply

Example

# Initialize
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform init 
​
# Plan
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform plan -var="admin_username=cloudguy" var="adminPassword=********"
​
<--- output truncated --->
​
# Apply
PS C:\Terraform\101-vm-simple-windows-visualstudio2019> terraform apply -var="admin_username=cloudguy" var="adminPassword=********"
​
<--- output truncated --->

Output

module.AddVMtNewVnet[0].azurerm_resource_group.arg-01: Creating...
module.AddVMtNewVnet[0].azurerm_resource_group.arg-01: Creation complete after 1s 
module.AddVMtNewVnet[0].azurerm_public_ip.apip-01: Creating...
​
<--- output truncated --->
​
module.AddVMtNewVnet[0].azurerm_windows_virtual_machine.avm-01: Creation complete after 2m54s

Apply complete! Resources: 8 added, 0 changed, 0 destroyed.
​
Outputs:
​
adminUsername = cloudguy

Code

    View the code in GitHub  
Last modified: 7 September 2020

Share it on     |   |   |   | 
comments powered by Disqus