Created
April 20, 2020 06:49
-
-
Save loujaybee/c571ee63b73877b8087b6bec182e8559 to your computer and use it in GitHub Desktop.
A Simple Apache Terraform Instance AWS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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