Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Refactored code to fix the backend definition" #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions loadbalancer/loadbalancer.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "oci_containerengine_node_pool" "oke_node_pool" {
node_pool_id = var.node_pool_id
data "oci_core_instances" "instances" {
compartment_id = var.compartment_id
}

resource "oci_network_load_balancer_network_load_balancer" "nlb" {
Expand Down Expand Up @@ -40,17 +40,17 @@ resource "oci_network_load_balancer_backend" "nlb_backend_http" {
network_load_balancer_id = oci_network_load_balancer_network_load_balancer.nlb.id
port = var.node_port_http
depends_on = [oci_network_load_balancer_backend_set.nlb_backend_set_http]
count = length(data.oci_containerengine_node_pool.oke_node_pool.nodes)
target_id = data.oci_containerengine_node_pool.oke_node_pool.nodes[count.index].id
count = var.node_size
target_id = data.oci_core_instances.instances.instances[count.index].id
}

resource "oci_network_load_balancer_backend" "nlb_backend_https" {
backend_set_name = oci_network_load_balancer_backend_set.nlb_backend_set_https.name
network_load_balancer_id = oci_network_load_balancer_network_load_balancer.nlb.id
port = var.node_port_https
depends_on = [oci_network_load_balancer_backend_set.nlb_backend_set_https]
count = length(data.oci_containerengine_node_pool.oke_node_pool.nodes)
target_id = data.oci_containerengine_node_pool.oke_node_pool.nodes[count.index].id
count = var.node_size
target_id = data.oci_core_instances.instances.instances[count.index].id
}

resource "oci_network_load_balancer_listener" "nlb_listener_http" {
Expand Down