Skip to content

Commit 365a519

Browse files
authored
Adding label prefix to logging agent names (#4)
1 parent e501ead commit 365a519

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/custom/customlog.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ resource "oci_logging_unified_agent_configuration" "linux_unified_agent_configur
1414

1515
compartment_id = var.compartment_id
1616
is_enabled = true
17-
description = format("%s-%s", "agentconfig", each.key)
18-
display_name = format("%s-%s", "agentconfig", each.key)
17+
description = var.label_prefix == "none" ? format("%s-%s", "agentconfig", each.key) : format("%s-%s-%s", var.label_prefix, "agentconfig", each.key)
18+
display_name = var.label_prefix == "none" ? format("%s-%s", "agentconfig", each.key) : format("%s-%s-%s", var.label_prefix, "agentconfig", each.key)
1919
service_configuration {
2020

2121
configuration_type = "LOGGING"
@@ -130,8 +130,8 @@ resource "oci_logging_unified_agent_configuration" "windows_unified_agent_config
130130

131131
compartment_id = var.compartment_id
132132
is_enabled = true
133-
description = format("%s-%s", "agentconfig", each.key)
134-
display_name = format("%s-%s", "agentconfig", each.key)
133+
description = var.label_prefix == "none" ? format("%s-%s", "agentconfig", each.key) : format("%s-%s-%s", var.label_prefix, "agentconfig", each.key)
134+
display_name = var.label_prefix == "none" ? format("%s-%s", "agentconfig", each.key) : format("%s-%s-%s", var.label_prefix, "agentconfig", each.key)
135135
service_configuration {
136136

137137
configuration_type = "LOGGING"

0 commit comments

Comments
 (0)