DevOps Classroom notes 24/May/2025

Terraform contd…

Configuring Terraform to work with Azure

  • Terraform by default uses Azure CLI Credentials
  • Once Azure CLI is installed. Launch Terminal and execute az login command
  • Azure has two providers

Lets create a storage account in Azure

Order of Creation

  • In Terraform, Resources are created in parallel unless they are dependent on each other.
  • There are two ways of defining dependencies
    • intrinsic/implicit
    • extrinsic/explicit

Resource name in terraform

  • This refers to pointing to a specific resource type.name
resource "azurerm_resource_group" "base" {
    name = "fromtf1"
    location = "centralindia"

}

# azurerm_resource_group.base

Explicit Dependency

  • Explicit dependecy can be added to a resource by using a meta argument called as depends_on
resource "azurerm_storage_account" "store" {
    name = "fromtfltmay25"
    resource_group_name = "fromtf1"
    location = "centralindia"
    account_tier = "Standard"
    account_replication_type = "RAGRS"
    # explicit dependency
    depends_on = [ azurerm_resource_group.base ]

}
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%