Skip to content

Commit e208206

Browse files
kierramarietoddgiguerevburckhardt
authored
test: ocp 4.15 version issue (#428)<br> - Security group naming changed slightly in ocp version 4.15, example was updated to handle this
Co-authored-by: [email protected] <[email protected]> Co-authored-by: toddgiguere <[email protected]> Co-authored-by: Vincent Burckhardt <[email protected]>
1 parent 5c128c8 commit e208206

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/add_rules_to_sg/main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ locals {
5555
{ name = "allow-port-443", direction = "inbound", tcp = { port_max = 443, port_min = 443 }, udp = null, icmp = null, remote = ibm_is_subnet.subnet_zone_1.ipv4_cidr_block },
5656
{ name = "udp-range", direction = "inbound", udp = { port_max = 30103, port_min = 30103 }, tcp = null, icmp = null, remote = ibm_is_subnet.subnet_zone_1.ipv4_cidr_block },
5757
]
58+
vpc_security_group = [for group in data.ibm_is_security_groups.vpc_security_groups.security_groups : group if startswith(group.name, "kube-") && endswith(group.name, module.ocp_base.vpc_id)][0]
59+
}
60+
61+
data "ibm_is_security_groups" "vpc_security_groups" {
62+
vpc_id = module.ocp_base.vpc_id
5863
}
5964

6065
# Kube-<vpc id> Security Group
6166
data "ibm_is_security_group" "kube_vpc_sg" {
62-
name = "kube-${module.ocp_base.vpc_id}"
67+
name = local.vpc_security_group.name
6368
}
6469

6570
resource "ibm_is_security_group_rule" "kube_vpc_rules" {

0 commit comments

Comments
 (0)