Skip to content

Instantly share code, notes, and snippets.

@loujaybee
Created April 20, 2020 06:49
Show Gist options
  • Save loujaybee/c571ee63b73877b8087b6bec182e8559 to your computer and use it in GitHub Desktop.
Save loujaybee/c571ee63b73877b8087b6bec182e8559 to your computer and use it in GitHub Desktop.
A Simple Apache Terraform Instance AWS
resource "aws_instance" "myInstance" {
ami = "ami-06ce3edf0cff21f07"
instance_type = "t2.micro"
user_data = <<-EOF
#!/bin/bash
sudo su
yum -y install httpd
echo "<p> My Instance! </p>" >> /var/www/html/index.html
sudo systemctl enable httpd
sudo systemctl start httpd
EOF
}
output "DNS" {
value = aws_instance.myInstance.public_dns
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment