Wednesday, August 16, 2023

What is Git ?

 


  • Git is created by Linus Torvalds in 2005

  • Git is the distributed version control system. This stored all version properly  and documented very well 

  • Git has ability to track of changes to content and provide mechanisms for sharing the content with other in team

  • This is open-source and free software

  • Available for multiple platforms (Linux, Unix, Mac, Windows )

  • Active community and more than 70%  developer used 

Wednesday, August 2, 2023

remote-exec Provisioner in terraform

 ##### remote-exec Provisioner demo


resource "aws_instance" "dev-instance" {


  ami           = "ami-05548f9cecf47b442"

  instance_type = "t2.micro"

  key_name = "pgsql_key"

  


  connection {

    type = "ssh"

    user = "ec2-user"

    private_key = file("./pgsql_key.pem")

    host = self.public_ip


  }


  provisioner "remote-exec" {


    inline = [ 

        "sudo yum install -y mysql*"

     ]

    

  }


}



Note: we can use existing key or generate new key 

Friday, July 28, 2023

Planning failed. Terraform encountered an error while generating this plan.

 


Error: invalid value for name (must only contain alphanumeric characters, hyphens, underscores, commas, periods, @ symbols, plus and equals signs)




Solutions : please check data type in associtaed variable block 

Thursday, July 27, 2023

How to use variable in terraform ?

 

main.tf



provider "aws" {

    region = "us-east-1"

  

}









resource "aws_security_group" "allow_ssh" {

    name = "allow_ssh_oracle_mssql_port"

    description = "allow_ssh_oracle_mssql_port "


    ingress {

    description      = "ssh-port"

    from_port        = 22

    to_port          = 22

    protocol         = "tcp"

    cidr_blocks      = [var.my_ip]

  }



  ingress {

    description      = "Oracle-port "

    from_port        = 1521

    to_port          = 1521

    protocol         = "tcp"

    cidr_blocks      = [var.my_ip]

  }



  ingress {

    description      = "MSSQL-Port"

    from_port        = 1433

    to_port          = 1433

    protocol         = "tcp"

    cidr_blocks      = [var.my_ip]

  }


  egress {

    from_port        = 0

    to_port          = 0

    protocol         = "-1"

    cidr_blocks      = ["0.0.0.0/0"]

    #ipv6_cidr_blocks = [var.my_ip]

  }


  tags = {

    Name = "allow_imp_port_Oracle_MSSQL_ssh"

  }

  




variables.tf


variable "my_ip" {

  default = "34.207.6.67/32"

}






Terraform commands


terraform init

terraform plan

terraform apply