matrixtest-IaC/lb.tf

29 lines
1.2 KiB
HCL

resource "openstack_networking_port_v2" "lbport" {
name = "lb${count.index + 1}-matrix-test-sunet-se-port"
# We create as many ports as there are instances created
count = var.lbsize # Number of loadbalancers
network_id = data.openstack_networking_network_v2.public.id
# A list of security group ID
security_group_ids = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
data.openstack_networking_secgroup_v2.allegress.id,
resource.openstack_networking_secgroup_v2.lbnode.id
]
admin_state_up = "true"
}
resource "openstack_networking_port_v2" "lbvip" {
name = "lb-vip-matrix-test-sunet-se-port"
# We create as many ports as there are instances created
network_id = data.openstack_networking_network_v2.public.id
# A list of security group ID
security_group_ids = [
data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
data.openstack_networking_secgroup_v2.allegress.id,
]
admin_state_up = "false"
}