Skip to content

Commit

Permalink
Merge pull request #7 from equalogic/remove-admin-sg
Browse files Browse the repository at this point in the history
Remove `sg_wireguard_admin` security group
  • Loading branch information
sgarner authored Feb 16, 2023
2 parents c51dd7c + ea6aae4 commit 372cc33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 43 deletions.
6 changes: 0 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
output "vpn_sg_admin_id" {
value = aws_security_group.sg_wireguard_admin.id
description = "ID of the internal Security Group to associate with other resources needing to be accessed on VPN."
}

output "vpn_sg_external_id" {
value = aws_security_group.sg_wireguard_external.id
description = "ID of the external Security Group to associate with the VPN."
Expand All @@ -12,4 +7,3 @@ output "vpn_asg_name" {
value = aws_autoscaling_group.wireguard_asg.name
description = "ID of the internal Security Group to associate with other resources needing to be accessed on VPN."
}

40 changes: 3 additions & 37 deletions wireguard-securitygroups.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
resource "aws_security_group" "sg_wireguard_external" {
name = "wireguard-${var.env}-external"
description = "Terraform Managed. Allow Wireguard client traffic from internet."
name = "wireguard-${var.env}"
description = "Wireguard Server"
vpc_id = var.vpc_id

tags = {
Name = "wireguard-${var.env}-external"
Name = "wireguard-${var.env}"
Project = "wireguard"
tf-managed = "True"
env = var.env
Expand All @@ -24,37 +24,3 @@ resource "aws_security_group" "sg_wireguard_external" {
cidr_blocks = ["0.0.0.0/0"]
}
}

resource "aws_security_group" "sg_wireguard_admin" {
name = "wireguard-${var.env}-admin"
description = "Terraform Managed. Allow admin traffic to internal resources from VPN"
vpc_id = var.vpc_id

tags = {
Name = "wireguard-${var.env}-admin"
Project = "vpn"
tf-managed = "True"
env = var.env
}

ingress {
from_port = 0
to_port = 0
protocol = "-1"
security_groups = [aws_security_group.sg_wireguard_external.id]
}

ingress {
from_port = 8
to_port = 0
protocol = "icmp"
security_groups = [aws_security_group.sg_wireguard_external.id]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}

0 comments on commit 372cc33

Please sign in to comment.