Very well presented. I think we can put local_exec provisioner in null_resource then use depends_on instead of using 'sleep'. This way terraform will wait until EC2 is ready before running local_exec
Requesting viewers to view and share with your friends. Your feedbacks are always welcome, so share honest ones, which can help us in delivering better content if there are any glitches in current.
remote-exec isnt working, it throwing error, when I am trying to echo on the new instance. The error is :- with aws_instance.ec2, │ on tf.tf line 154, in resource "aws_instance" "ec2": │ 154: provisioner "remote-exec" { │ │ Failed to read ssh private key: no key found
Upto some extend yes. But the point they differ is that userdata can go along with provisioning. Provisioners may require some additional configuration while connecting from some remote machine.
Hi , I tried the code in method1. getting the below error. Error: Cycle: aws_instance.r100c96 (expand), aws_instance.r100c96 Could you please help how to fix this
good content, I was always confused about how all these tools work togather, finally got the answer. thankyou @hemant. also could you create a tutorial on complete devops pipeline.. end to end
Hello Venkatesh, Well no, it's not an alternative. Both are independent solutions having its own pros and cons. Where Ansible is majorly targetted towards configuration management, terraform is more of infrastructure provisioning tool (so deployment on clouds is much easier with terraform as compared to any script or python wrapper or any other method). So it depends on one, how they pick as per their requirement. Hope is answered the query
Hello Mraja, Well terraform works on windows as well. Remaining provisioner part, one can simply use powershell Or any other configuration management tool which windows support
@@mrajakumar474 I will try to find some examples, my core is from Linux OS, so i don't stress much on Windows side. Still stay assured will find or create one for you.