DevOps Classroom notes 15/Sep/2024

Terraform installation

  • Refer Here for docs and classroom video for setup

Terraform Workflow

  • Create a new folder for every infra
  • we will be adding .tf files
  • initialize terraform
  • validate terraform
  • format terraform
  • apply
  • destroy

Configuring Terraform AWS and AzureRm Provider (Authentication)

  • Ensure your system is configured as discussed in the class
  • Azure example
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "4.2.0"
    }
  }
}

provider "azurerm" {
  # Configuration options
  features {  }
  subscription_id = "<your-subcription-id>"
}

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

  • AWS Example
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.67.0"
    }
  }
}

provider "aws" {
  # Configuration options
}

resource "aws_vpc" "base" {
  cidr_block = "10.0.0.0/16"
  tags = {
    Name = "aws-vpc"
  }

}

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

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

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Exit mobile version
%%footer%%