@@ -65,6 +65,7 @@ variable "availability_domain" {
65
65
}
66
66
67
67
provider "oci" {
68
+ # version = "5.29.0"
68
69
tenancy_ocid = var. tenancy_ocid
69
70
user_ocid = var. user_ocid
70
71
fingerprint = var. fingerprint
@@ -73,12 +74,12 @@ provider "oci" {
73
74
}
74
75
75
76
data "oci_identity_availability_domain" "ad1" {
76
- compartment_id = var. tenancy_ocid // needs to be compartment_ocid if not using root compartment
77
+ compartment_id = var. compartment_ocid // needs to be compartment_ocid if not using root compartment
77
78
ad_number = 1
78
79
}
79
80
80
81
data "oci_identity_availability_domain" "ad2" {
81
- compartment_id = var. tenancy_ocid // needs to be compartment_ocid if not using root compartment
82
+ compartment_id = var. compartment_ocid // needs to be compartment_ocid if not using root compartment
82
83
ad_number = 2
83
84
}
84
85
@@ -268,6 +269,8 @@ resource "oci_load_balancer" "lb1" {
268
269
reserved_ips {
269
270
id = oci_core_public_ip. test_reserved_ip . id
270
271
}
272
+
273
+ is_delete_protection_enabled = " false"
271
274
}
272
275
273
276
resource "oci_load_balancer" "lb2" {
@@ -326,6 +329,7 @@ resource "oci_load_balancer_backend_set" "lb-bes1" {
326
329
name = " lb-bes1"
327
330
load_balancer_id = oci_load_balancer. lb1 . id
328
331
policy = " ROUND_ROBIN"
332
+ backend_max_connections = " 1000"
329
333
330
334
health_checker {
331
335
port = " 80"
@@ -500,6 +504,7 @@ resource "oci_load_balancer_backend" "lb-be1" {
500
504
drain = false
501
505
offline = false
502
506
weight = 1
507
+ max_connections = 300
503
508
}
504
509
505
510
resource "oci_load_balancer_backend" "lb-be2" {
@@ -511,6 +516,7 @@ resource "oci_load_balancer_backend" "lb-be2" {
511
516
drain = false
512
517
offline = false
513
518
weight = 1
519
+ max_connections = 450
514
520
}
515
521
516
522
resource "oci_load_balancer_rule_set" "test_rule_set" {
@@ -571,6 +577,26 @@ resource "oci_load_balancer_rule_set" "test_rule_set" {
571
577
name = " example_rule_set_name"
572
578
}
573
579
580
+ resource "oci_load_balancer_rule_set" "ip_based_max_connections_ruleset" {
581
+ load_balancer_id = oci_load_balancer. lb2 . id
582
+ name = " ip_based_max_connections_ruleset"
583
+
584
+ items {
585
+ action = " IP_BASED_MAX_CONNECTIONS"
586
+ default_max_connections = 20
587
+
588
+ ip_max_connections {
589
+ ip_addresses = [" 10.10.1.0/24" , " 150.136.187.0/24" ]
590
+ max_connections = 300
591
+ }
592
+
593
+ ip_max_connections {
594
+ ip_addresses = [" 10.10.2.0/24" , " 151.0.0.0/8" ]
595
+ max_connections = 10
596
+ }
597
+ }
598
+ }
599
+
574
600
output "lb_public_ip" {
575
601
value = [oci_load_balancer . lb1 . ip_address_details ]
576
602
}
0 commit comments