Skip to main content

Posts

Showing posts from April, 2020

Terraform - Build Azure VM and provision with shell script

Terraform - Build Azure VM and provision with shell script Below will be performed 1. Create linux virtual machine 2. Provision virtual machine with shell script using remote-exec Below is terraform code - main.tf main.tf provider "azurerm" {     # The "feature" block is required for AzureRM provider 2.x.     # If you're using version 1.x, the "features" block is not allowed.     version = "=2.0"         features {}     subscription_id = "xxxxxx"     client_id       = "xxxxxxx"     client_secret   = "xxxxxxxxxxxxx"     tenant_id       = "xxxxxxxxxxxxxxxxx" } resource "azurerm_resource_group" "resgrp1" {     name     = "ajdocker2"     location = "eastus"     tags = {         environment = "Aj project1"     } } resource "azurerm_virtual_network" "vnet1" {     name                = "ajvnet1"     address_space