diff --git a/main.tf b/main.tf index 59bff64..d64f0d1 100644 --- a/main.tf +++ b/main.tf @@ -39,9 +39,9 @@ data "aws_ami" "ubuntu" { resource "aws_instance" "web" { ami = data.aws_ami.ubuntu.id - subnet_id = "subnet-0af26127322faf38a" + # subnet_id = "subnet-0af26127322faf38a" instance_type = "t2.micro" - vpc_security_group_ids = [aws_security_group.web-sg.id] + # vpc_security_group_ids = [aws_security_group.web-sg.id] user_data = <<-EOF #!/bin/bash @@ -53,22 +53,22 @@ resource "aws_instance" "web" { EOF } -resource "aws_security_group" "web-sg" { - name = "${random_pet.sg.id}-sg" - ingress { - from_port = 8080 - to_port = 8080 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} +# resource "aws_security_group" "web-sg" { +# name = "${random_pet.sg.id}-sg" +# ingress { +# from_port = 8080 +# to_port = 8080 +# protocol = "tcp" +# cidr_blocks = ["0.0.0.0/0"] +# } +# // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` +# egress { +# from_port = 0 +# to_port = 0 +# protocol = "-1" +# cidr_blocks = ["0.0.0.0/0"] +# } +# } output "web-address" { value = "${aws_instance.web.public_dns}:8080"