-
Notifications
You must be signed in to change notification settings - Fork 4
/
loadbalancer.tf
46 lines (37 loc) · 1.56 KB
/
loadbalancer.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resource "oci_load_balancer_load_balancer" "FoggyKitchenPublicLoadBalancer" {
shape = "100Mbps"
compartment_id = oci_identity_compartment.FoggyKitchenCompartment.id
subnet_ids = [
oci_core_subnet.FoggyKitchenLBSubnet.id
]
display_name = "FoggyKitchenPublicLoadBalancer"
}
resource "oci_load_balancer_backendset" "FoggyKitchenPublicLoadBalancerBackendset" {
name = "FoggyKitchenPublicLBBackendset"
load_balancer_id = oci_load_balancer_load_balancer.FoggyKitchenPublicLoadBalancer.id
policy = "ROUND_ROBIN"
health_checker {
port = "80"
protocol = "HTTP"
response_body_regex = ".*"
url_path = "/"
interval_ms = "3000"
}
}
resource "oci_load_balancer_listener" "FoggyKitchenPublicLoadBalancerListener" {
load_balancer_id = oci_load_balancer_load_balancer.FoggyKitchenPublicLoadBalancer.id
name = "FoggyKitchenPublicLoadBalancerListener"
default_backend_set_name = oci_load_balancer_backendset.FoggyKitchenPublicLoadBalancerBackendset.name
port = 80
protocol = "HTTP"
}
resource "oci_load_balancer_backend" "FoggyKitchenPublicLoadBalancerBackend" {
load_balancer_id = oci_load_balancer_load_balancer.FoggyKitchenPublicLoadBalancer.id
backendset_name = oci_load_balancer_backendset.FoggyKitchenPublicLoadBalancerBackendset.name
ip_address = oci_core_instance.FoggyKitchenWebserver.private_ip
port = 80
backup = false
drain = false
offline = false
weight = 1
}