Terraform: 101-vm-linux-serial-output


Kiran Patnayakuni   |   Co-authors:  Anusha DokulaVeeresh Setty

Simple Linux VM created with serial/console output configured

Description

This is an Azure quickstart sample terraform configuration based on ARM template 101-vm-linux-serial-output  from the repository azure\azure-quickstart-templates .

This is a simple configuration that will create a single VM with very limited parameters in order to demonstrate how to configure serial and console output, and it will deploy the following resources…

Note:

If the specified resource group is already exist then the script will not continue with the deployment. If you want to deploy the resources to the existing resource group, then import the resource group to state before deployment.

Syntax

# To initialize the configuration directory
PS C:\Terraform\101-vm-linux-serial-output> terraform init 

# To check the execution plan
PS C:\Terraform\101-vm-linux-serial-output> terraform plan

# To deploy the configuration
PS C:\Terraform\101-vm-linux-serial-output> terraform apply

Example

# Initialize
PS C:\Terraform\101-vm-linux-serial-output> terraform init 

# Plan
PS C:\Terraform\101-vm-linux-serial-output> terraform plan -var="adminUsername=cloudguy" 

var.adminPassword
The admin password of the VM.
Enter a value: *********

<--- output truncated --->

# Apply
PS C:\Terraform\101-vm-linux-serial-output> terraform apply -var="adminUsername=cloudguy" 

var.adminPassword
The admin password of the VM
Enter a value: *********

Output

azurerm_resource_group.arg-01: Creating...
azurerm_resource_group.arg-01: Creation complete after 2s 
azurerm_virtual_network.avn-01: Creating...

<--- output truncated --->

azurerm_linux_virtual_machine.avm-ssh-01: Still creating... [1m30s elapsed]
azurerm_linux_virtual_machine.avm-ssh-01: Creation complete after 1m39s 

Apply complete! Resources: 10 added, 0 changed, 0 destroyed.

Code

    View the code in GitHub  
Last modified: 18 September 2020

Share it on     |   |   |   | 
comments powered by Disqus