DevOps Classroom notes 20/Aug/2026

terraform local variable

Referhere

variable conditions

Referhere

terraform null resource

Referhere Ex: created multiple resources i need that details

provisioner

  1. copy files to existing ec2 instance
  2. run commands or do patching ec2 instance

Azure with terraform

Pre-requests:

  1. azure cli
  2. terraform
  3. git

Local & cicd

az login service prinical

azure providers

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=5.0.0"
    }
  }
}

# Configure the Microsoft Azure Provider
provider "azurerm" {
  features {}
}

create resource group

### variables

variable "resource_group_names" {
    type = list(string)
    default = [ "devops", "demo-2" ]
  
}

variable "locations" {
    type = list(string)
    default = [ "Central India", "Central US" ]
  
}

### resources


resource "azurerm_resource_group" "rg" {
  count    = length(var.resource_group_names)

  name     = var.resource_group_names[count.index]
  location = var.locations[count.index]

  managed_by = "devops"

  tags = {
    env = "prod"
  }
}

try task in azure

  1. create resource_group
  2. vnet and subnets
  3. create public ip

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube