patkoch / terraform-azure-virtual-machine-linux

Terraform configuration for a deployment of a Linux virtual machine on Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform configuration for deploying a Linux (Ubuntu) virtual machine on Azure

Create a public/private key pair

In the same directory as your .tf files are located, run

  ssh-keygen -f id_rsa

Skip the passphrase.

Deployment of the virtual machine using Terraform

Conduct the initialization with the following command:

  terraform init

Make sure your Terraform configuration files are in the desired format, by using:

terraform fmt

Validate your Terraform configuration

terraform validate

Create a Terraform plan by running:

terraform plan -out tfplan

Deploy the Ubuntu VM on Azure executing:

terraform apply tfplan

Access the virtual machine

Ensure the proper permission for the private key:

chmod 600 id_rsa

Establish a connection to the virtual machine using:

ssh -i id_rsa adminuser@<public ip address>

Destruction of the virtual machine using Terraform

Destroy the Ubuntu VM on Azure executing:

terraform destroy

About

Terraform configuration for a deployment of a Linux virtual machine on Azure


Languages

Language:HCL 100.0%