TF assignment for day1 by Aniruddha Laha

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Assignment – 1

List of Components of Terraform and explain each components with 1 image

Ans : Terraform has two important components: Terraform Core and Terraform Plugins.Terraform Core oversees the reading and interpolation of resource plan executions, resource graphs, state management features and configuration files.

Terraform Plugins are responsible for defining resources for specific services. This includes authenticating infrastructure providers and initializing the libraries used to make API calls.

Specific to Azure

AzureRM: Manage stable Azure resources and functionality such as virtual machines, storage accounts, and networking interfaces.

AzureAD: Manage Azure Active directory resources such as groups, users, service principals, and applications.

AzureDevops: Manage Azure DevOps resources such as agents, repositories, projects, pipelines, and queries.

Azure Stack: Manage Azure Stack resources such as virtual machines, DNS, VNet, and storage.

Assignment – 2

Write a terraform file which must create 1 azure resources group + 1 aws instance and 1 github repo. All the code must be into 1 file including providers.

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.12.0"
    }
	aws = {
      source = "hashicorp/aws"
      version = "4.21.0"
    }
  github = {
      source  = "integrations/github"
      version = "~> 4.0"
    }
  }
}

provider "azurerm" {
  features {}
  subscription_id = "54d18623-a88e-4b6e-bcfe-a772406993b0"
  client_id       = "7e757450-7239-4c36-88f8-6664f3e49a49"
  client_secret   = "yhJ8Q~T7ycWjr4PjQ2ZUkTKgLeKTQ82YYGdiscP9"
  tenant_id       = "bc0f52a6-5a6d-45f4-8842-36ab113a5eb5"
}

provider "aws" {
  # Configuration options
}

provider "github" {
  token = "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"
} 


resource "azurerm_resource_group" "example" {
  name     = "devopsschool-test2"
  location = "South India"
}

resource "github_repository" "example" {
  name        = "devopsschool12"
  description = "My awesomecodebase"

  visibility = "public"

}

resource "aws_instance" "web" {
  ami           = "ami-08df646e18b182346"
  instance_type = "t3.micro"

  tags = {
    Name = "HelloWorld-1"
  }
}
Subscribe
Notify of
guest

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

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x