-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a007c40
commit 9d24afb
Showing
7 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
data "oci_integration_integration_instances" "integration_instances" { | ||
for_each = var.logdefinition | ||
compartment_id = var.compartment_id | ||
|
||
#Optional | ||
display_name = each.value.resource | ||
state = "ACTIVE" | ||
} | ||
|
||
resource "oci_logging_log" "integration_log" { | ||
for_each = var.logdefinition | ||
|
||
display_name = var.label_prefix == "none" ? each.key : format("%s-%s", var.label_prefix, each.key) | ||
log_group_id = var.loggroup[each.value.loggroup].id | ||
log_type = "SERVICE" | ||
configuration { | ||
source { | ||
category = "activitystream" | ||
resource = data.oci_integration_integration_instances.integration_instances[each.key].integration_instances.0.id | ||
service = "integration" | ||
source_type = "OCISERVICE" | ||
} | ||
} | ||
|
||
is_enabled = lookup(each.value, "enable", true) | ||
retention_duration = var.log_retention_duration | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "int_logid" { | ||
value = { for v in oci_logging_log.integration_log : v.display_name => v.id } | ||
} | ||
|
||
output "int_loggroupid" { | ||
value = { for k, v in var.loggroup : v.display_name => v.id } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "label_prefix" { | ||
default = "none" | ||
description = "A string that will be prepended to log resources." | ||
type = string | ||
} | ||
variable "logdefinition" { | ||
type = map(any) | ||
description = "Log definition" | ||
} | ||
variable "log_retention_duration" { | ||
type = string | ||
description = "Duration to retain logs" | ||
} | ||
|
||
variable "compartment_id" { | ||
type = string | ||
description = "Compartment ID where the resources will be created" | ||
} | ||
|
||
variable "loggroup" { | ||
type = map(any) | ||
description = "Log Group" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters