πŸš€ DevOps Certified Professional
πŸ“… Starting: 1st of Every Month 🀝 +91 8409492687 | 🀝 +1 (469) 756-6329 πŸ” Contact@DevOpsSchool.com

terraform with provisioner

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!






resource "aws_instance" "godwin" {

  ami           = "ami-03d5c68bab01f3496"
  instance_type = "t2.micro"
  key_name-"godwin_key"
  
  connection {
      type     = "ssh"
      user     = "ubuntu"
      private_key = file("godwin_key.pem")
      #host = aws_instance.web.public_ip
      host = self.public_ip
  }

 
 
 provisioner "file" {
    source      = "playbook.yml"
    destination = "/tmp/"
  }   

  provisioner "remote-exec" {
    inline = [
	  "sudo apt-get update",
       "sudo apt install software-properties-common",
"sudo add-apt-repository --yes --update ppa:ansible/ansible",
"sudo apt install ansible -y",
"ansible-playbook playbook.yml --check",
    ]
  }
  
  
}