DevOps Classroom Series – 20/May/2020

Lab Setup

  1. Cloud Accounts
    • AWS
    • Azure
  2. Windows:
    choco install git -y
    
  3. Mac:
  4. Visual Studio Code:
  5. Packer:
    • Windows: choco install packer -y
    • MAC: brew install packer
  6. Terraform
    • Windows: choco install terraform -y
    • MAC: brew install terraform

Concepts to understand in Terraform

  • Provider:
    • Provider in Terraform will provide underlying interactions and exposes resources and Datasources to Terraform.
    • To put it in simple representation Provider is where you want infra to be created Preview
  • Resource:
    • Infrastructure element which you are creating
  • Configuration Language:
    • To create infrastructure in Terraform, we need to learn configuration language

    • Sample Terraform

    provider "aws" {
    access_key = "AKIAIH524E5KGVKCZSIQ"
    secret_key = "SpQyL9UEbSa5YOyXSk5oGSfAsvi7JLJOJxIdFEYC"
    region = "us-west-2"
    }
    
    resource "aws_instance" "apache" {
        ami = "ami-0ec2b1175747b5db9"
        instance_type = "t2.micro"
    
    }
    

Scenario : Hello-World To Infra Provisioning (AWS) to understand what has to be done in terraform.

  1. Create a VPC in AWS in mumbai region.

    • Manual Steps are: Preview Preview Preview Preview Preview
    • IN Terraform:
    • Configure Terraform aws provider Refer Here
    • Find resource in aws provider to create vpc Refer Here Preview
  2. Create a VNET in Azure in Central US

    • Manual Steps are

      1. Create a Resource group
      2. Create a VNET Preview Preview Preview
    • In Terraform, Find a azure provider Refer Here and then find a resource group resource Refer Here and then virtual network resource Refer Here

Leave a Reply

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

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube