DevOps Classroom Notes 08/08/2021

What is Terraform state

  • Every time we run terraform it records information about the infrastructure it created in the Terraform state file. By default when we run terraform in a folder , terrafrom creates a file in the same folder terraform.tfstate.
  • This file is in JSON format that records mapping of terraform resources in our configuration file to the representation of resources in the real world
  • Note: This state file format is private API for terraform and changes for every release, we should never edit the terraform.tfstate file. Preview
  • When we can configure terraform in such a way that it stores the tfstate file in common location, we can use terraform with in a team Preview
  • This feature we will be learning soon & is called as Remote Backend.
  • Now lets apply the infrastructure which we are building and view the state file
  • Refer Here for the private route table.

Lets try to create the ntier with vm on Azure

  • Architecture to be realized Preview
  • In the visual studio lets add an extension of terraform azure by microsoft Preview
  • The Azure provider for terraform Refer Here
  • To get Azure Credentials
    • Login into Azure and launch cloud shell Preview Preview Preview

    • Lets execute a command az ad sp create-for-rbac --query "{client_id: appId, client_secret: password, tenant_id: tenant }

    • Preserve the output to some notepad

    • Now execute the following command “`az account show –query "{ subscription_id: id}" and preserve the subscription id

  • Creating a virtual network with three subnets
    • Manually (refer classroom video as well) Preview Preview
  • Terraform configuration applied for azure Refer Here. Preview
  • Refer Here for the changeset containing changes to add network security group and network interface
  • Now lets try to create an azure linux ubuntu vm

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner