Skip to content

Commit

Permalink
Merge pull request #26 from OpenVPN/feature/terraform_code
Browse files Browse the repository at this point in the history
Adding rules for security group
  • Loading branch information
joao-diasx authored Nov 27, 2024
2 parents 96df3c2 + 7866fe3 commit d48184c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ resource "ibm_is_security_group" "sg" {
name = var.security_group_name
vpc = var.create_vpc ? ibm_is_vpc.vpc[0].id : data.ibm_is_vpc.existing_vpc[0].id
}

resource "ibm_is_security_group_rule" "allow_vpn_ports" {
direction = "inbound"
group = ibm_is_security_group.sg.id
ip_version = "ipv4"
remote = "0.0.0.0/0"

tcp {
port_min = 22
port_max = 443
}
}
resource "ibm_is_security_group_rule" "allow_all_outbound" {
direction = "outbound"
group = ibm_is_security_group.sg.id
remote = "0.0.0.0/0"
ip_version = "ipv4"
}

0 comments on commit d48184c

Please sign in to comment.