Last active
January 12, 2020 08:41
-
-
Save anvodev/2ff0b469d2aa01ed6ee7ad9aae33a2fc to your computer and use it in GitHub Desktop.
This file contains 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
provider "aws" { | |
region = "ap-southeast-1" | |
} | |
resource "aws_security_group" "instance" { | |
name = "poc-instance" | |
ingress { | |
from_port = 8080 | |
to_port = 8080 | |
protocol = "tcp" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
} | |
resource "aws_instance" "poc" { | |
ami = "ami-0123b531fc646552f" | |
instance_type = "t2.micro" | |
vpc_security_group_ids = [aws_security_group.instance.id] | |
user_data = <<-EOF | |
#!/bin/bash | |
echo "Hello, World!" > index.html | |
nohup busybox httpd -f -p 8080 & | |
EOF | |
tags = { | |
Name = "poc" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment