Skip to content

Commit

Permalink
remote access
Browse files Browse the repository at this point in the history
  • Loading branch information
LamSut committed Nov 19, 2024
1 parent 2874c48 commit 08291f0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
21 changes: 15 additions & 6 deletions ec2/main.tf
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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]

Expand All @@ -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]

Expand Down
14 changes: 14 additions & 0 deletions vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 08291f0

Please sign in to comment.