Azure: Deploy a simple Windows VM (101-vm-simple-windows) using Terraform

This terraform configuration will deploy a simple Windows VM on Azure cloud, and this is a conversion of 101-vm-simple-windows from azure_quickstart_templates. This configuration consists of two .tf files (variables.tf and main.tf) and deploy a single vm with the following resources…

  • Visualized in ARMVIZ

101-vm-simple-windows

  • Deployed resources

resources

Configuration

  • variables.tf

Variables are separated from the main configuration, and this configuration accepts the variable below…

  • main.tf

This file contains the actual configuration to create a simple Windows VM…

Deploy the configuration

Authentication

Please use AzureCli to authenticate to your Azure cloud environment, terraform can use the same session to deploy the resources. Check here for alternate methods of authentication.

Initialization

First time you need to initialize the configuration directory, where it will download the necessary plugins to deploy the current configuration, to initialize you need to run the command below…

terraform init

Plan

Terraform will check for the syntax errors and generates the execution plan, you can also save this plan for your future deployments

terraform plan

Apply

To apply the configuration run the command below…

terraform apply

Thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.