Terraform assignment for 4 July 2022- Akhil

1.Harshiorp configuration Language – This is the terraform language in which the code to created or updated

2. Terraform – Make all the code in the single code and with the help of providers it update or create or destroy the API of target environment (AWS,AZURE,GCP,K8S etc)

3. Providers – Its kind of plugin which help the Terraform do the communication with many cloud providers API

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"
}
resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"


provider "aws" {
  # Configuration options
}

resource "aws_instance" "web" {
  ami           = data.aws_ami.ubuntu.id
  instance_type = "t3.micro"

  tags = {
    Name = "HelloWorld"
  }
}

provider "github" {
  token = "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"
}
resource "github_repository" "example" {
             name        = "Akhil-terraform"
             description = "My awesome codebase
       visibility = "public"
}


Subscribe
Notify of
guest

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

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