Terraforms

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Comparison B/W Ansible, Docker and Terraform

Ansible Docker Terraform
Ansible is a configuration management toolDocker is a container toolTerraform is an Orchestration tool
It provides support for mutable infrastructureIt provides support for immutable infrastructureIt provides support for immutable infrastructure
It follows a procedural languageIt follows a declarative languageIt follows a declarative language
It provides complete support for packaging and templating It provides support for packaging and templatingIt provides partial support for packaging and templating
It does not have lifecycle managementIt follows lifecycleIt depends on lifecycle and state management

Terraform Script to create linux Ec2 instance with security groups

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}
provider "aws" {
  region = "us-west-2"

  access_key = "my-access-key"
  secret_key = "my-secret-key"
}
resource "aws_instance" "hari-first-ec2" {
  ami           = "ami-03d5c68bab01f3496"
  instance_type = "t2.micro"

    tags = {
    Name = "Harish"
  }
}
resource "aws_security_group" "ResourceGroup" {
  name        = "allow_tls"
  description = "Allow TLS inbound traffic"
  vpc_id      = aws_vpc.main.id

  tags = {
    Name = "harishResourceGroup"
  }
}
resource "aws_key_pair" "deployer" {
  key_name   = "deployer-key"
  public_key = ""
}