-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging.tf
48 lines (45 loc) · 1.46 KB
/
logging.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
44
45
46
47
48
# Copyright © 2023, Oracle and/or its affiliates.
# All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
resource "oci_logging_log_group" "logging_log_group" {
count = var.enable_lb_logging ? 1 : 0
compartment_id = local.compartment_ocid
display_name = format("%s-log-group", var.label_prefix)
}
resource "oci_logging_log" "lb_error_log" {
count = var.enable_lb_logging ? 1 : 0
configuration {
compartment_id = local.compartment_ocid
source {
category = "error"
resource = oci_load_balancer.lb.id
service = "loadbalancer"
source_type = "OCISERVICE"
}
}
display_name = format("%s-lb-error", var.label_prefix)
freeform_tags = {
}
is_enabled = "true"
log_group_id = oci_logging_log_group.logging_log_group[0].id
log_type = "SERVICE"
retention_duration = "30"
}
resource "oci_logging_log" "lb_access_log" {
count = var.enable_lb_logging ? 1 : 0
configuration {
compartment_id = local.compartment_ocid
source {
category = "access"
resource = oci_load_balancer.lb.id
service = "loadbalancer"
source_type = "OCISERVICE"
}
}
display_name = format("%s-lb-access", var.label_prefix)
freeform_tags = {
}
is_enabled = "true"
log_group_id = oci_logging_log_group.logging_log_group[0].id
log_type = "SERVICE"
retention_duration = "30"
}