DevOps Classroomnotes 26/Jul/2023

Architecture of Terraform

  • Terraform is developed in Go language and installation of terraform is one executable
  • Providers are not part of terraform installations as we try to create infra, as part of initializations providers are downloaded
  • Providers have resources and datasources as part of it
    Preview

Concepts of Terraform

  • Provider: This determines the target area to create infra structure
  • Terraform providers are of three categories
    • official
    • partner
    • community
  • Refer Here for providers documenation by hashicorp
  • Note: For you reference we have used the following template
terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "2.33.0"
    }
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=3.0.0"
    }
  }
}

provider "azurerm" {
    features {

    }
}

provider "aws" {
    region = "us-west-2"
}

resource "aws_instance" "fromtf" {
    ami = "ami-03f65b8614a860c29"
    tags = {
      Name ="from terraform"
    }
    key_name = "my_id_rsa"
    vpc_security_group_ids = ["sg-05adaf452b268c335"]
    instance_type = "t2.micro"

}


resource "azurerm_resource_group" "test" {
    name = "test"
    location = "eastus"

}
  • Arguments and Attributes:
    • Argument refers to inputs in terraform
    • Attributes refers to outputs in terraform

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner