-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlogging.tf
70 lines (61 loc) · 3.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# ------------------------------------------------------------------------------
# Trivadis - Part of Accenture, Platform Factory - Data Platforms
# Saegereistrasse 29, 8152 Glattbrugg, Switzerland
# ------------------------------------------------------------------------------
# Name.......: logging.tf
# Author.....: Stefan Oehrli (oes) [email protected]
# Editor.....: Stefan Oehrli
# Date.......: 2023.04.19
# Revision...:
# Purpose....: Define OCI Log Group for private subnet.
# Notes......: --
# Reference..: --
# License....: Apache License Version 2.0, January 2004 as shown
# at http://www.apache.org/licenses/
# ------------------------------------------------------------------------------
# create the log group ---------------------------------------------------------
resource "oci_logging_log_group" "log_group" {
count = var.numberOf_labs
compartment_id = var.compartment_id
display_name = var.label_prefix == "none" ? format("${local.resource_shortname}%02d_log_group", count.index) : format("${var.label_prefix}-${local.resource_shortname}%02d_log_group", count.index)
freeform_tags = var.tags
}
# create a default log ---------------------------------------------------------
resource "oci_logging_log" "default_log_private_subnet" {
count = var.numberOf_labs
display_name = var.label_prefix == "none" ? format("${local.resource_shortname}%02d_log_private_subnet", count.index) : format("${var.label_prefix}-${local.resource_shortname}%02d_log_private_subnet", count.index)
log_group_id = oci_logging_log_group.log_group[count.index].id
log_type = var.log_type
configuration {
source {
category = var.log_configuration_source_category
resource = oci_core_subnet.private_subnet[count.index].id
service = var.log_configuration_source_service
source_type = var.log_configuration_source_source_type
}
compartment_id = var.compartment_id
}
freeform_tags = var.tags
is_enabled = var.log_is_enabled
retention_duration = var.log_retention_duration
}
# create a default log ---------------------------------------------------------
resource "oci_logging_log" "default_log_public_subnet" {
count = var.numberOf_labs
display_name = var.label_prefix == "none" ? format("${local.resource_shortname}%02d_log_public_subnet", count.index) : format("${var.label_prefix}-${local.resource_shortname}%02d_log_public_subnet", count.index)
log_group_id = oci_logging_log_group.log_group[count.index].id
log_type = var.log_type
configuration {
source {
category = var.log_configuration_source_category
resource = oci_core_subnet.public_subnet[count.index].id
service = var.log_configuration_source_service
source_type = var.log_configuration_source_source_type
}
compartment_id = var.compartment_id
}
freeform_tags = var.tags
is_enabled = var.log_is_enabled
retention_duration = var.log_retention_duration
}
# --- EOF ----------------------------------------------------------------------