Skip to content

Commit

Permalink
Adding rules for security group
Browse files Browse the repository at this point in the history
  • Loading branch information
jregino2099 committed Nov 27, 2024
1 parent 069ac9b commit 7866fe3
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 7866fe3

Please sign in to comment.