Hans Bhardwaj – Azure DevOps & Terraform Training Day -1 -Assignment-2
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
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.26.1"
}
}
}
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" "training" {
name = "training_assignment"
location = "South India"
}
provider "github" {
token="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"
}
resource "github_repository" "training" {
name = "training_assignment"
description = "My training assignment"
visibility = "public"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "training" {
cidr_block = "10.0.0.0/16"
}