Terraform setting up simple web server !! Getting Started Part-2!!
In our last post " Getting started with terraform ", we just learn how to launch a simple EC2 instance in AWS. In this article we will dig more and will try to create a simple web server and try to access that. Architecture - We are not installing proper web-server, its just a hack. Using busybody to launch http process. #!/bin/bash echo "Hello, World" > index.html nohup busybox httpd -f -p 8080 & resource "aws_instance" "example" { ami = "ami-0cfee17793b08a293" instance_type = "t2.micro" user_data = << - EOF // Together #!/bin/bash echo "Hello, World" > index . html nohup busybox httpd -f -p 8080 & EOF tags = { Name = "terraform-example" } } The << - EOF (together) and EOF are Terraform’s heredoc syntax, which allows...