diff --git a/ec2/main.tf b/ec2/main.tf index c6ee76c..af6a350 100644 --- a/ec2/main.tf +++ b/ec2/main.tf @@ -1,6 +1,9 @@ resource "aws_instance" "server_1" { - ami = "ami-06b21ccaeff8cd686" - instance_type = "t2.micro" + ami = "ami-06b21ccaeff8cd686" + instance_type = "t2.micro" + + key_name = "lamsutdeptraivcl" + subnet_id = var.subnet security_groups = [var.security_group] @@ -10,8 +13,11 @@ resource "aws_instance" "server_1" { } resource "aws_instance" "server_2" { - ami = "ami-0866a3c8686eaeeba" - instance_type = "t2.micro" + ami = "ami-0866a3c8686eaeeba" + instance_type = "t2.micro" + + key_name = "lamsutdeptraivcl" + subnet_id = var.subnet security_groups = [var.security_group] @@ -21,8 +27,11 @@ resource "aws_instance" "server_2" { } resource "aws_instance" "server_3" { - ami = "ami-0324a83b82023f0b3" - instance_type = "t2.micro" + ami = "ami-0324a83b82023f0b3" + instance_type = "t2.micro" + + key_name = "lamsutdeptraivcl" + subnet_id = var.subnet security_groups = [var.security_group] diff --git a/vpc/main.tf b/vpc/main.tf index 2bc2b9c..5d23010 100644 --- a/vpc/main.tf +++ b/vpc/main.tf @@ -58,6 +58,20 @@ resource "aws_security_group" "security_group" { cidr_blocks = ["0.0.0.0/0"] } + ingress { + from_port = 3389 //for Windows Remote Connection + to_port = 3389 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + ingress { + from_port = -1 + to_port = -1 + protocol = "icmp" + cidr_blocks = ["0.0.0.0/0"] + } + egress { from_port = 0 to_port = 0