Terraform code to spin up a small Ubuntu VM in the Azure Cloud. To prevent unexpected behaviour execute all commands in a Powershell.
- Terraform
- Azure Subscription
- Azure CLI
- (not required but recommended): VS Code with Remote-SSH extension.
- Replace the ip in
terraform.tfvarswith your own ip address. Pay attention to keep the cidr block format. - Set the paths to the public and private key file in
terraform.tfvarsto establish an SSH connection to your VM. - Replace the path in
windows-ssh-script.tplwith a path to your own ssh config. - Modify the
customdata.tplfile to prepare the VM in your own way. - Run
az loginand login to your Azure Account. - Run
terraform initto initialize terraform working directory. - Execute
terraform applyand confirm - (Optional) Connect to your Azure VM via Remote-SSH extension (Connect to Host...)