From d935329816b31535e13084f599e4637ab54118f8 Mon Sep 17 00:00:00 2001 From: Andre Correa Date: Wed, 8 Jan 2025 12:17:01 -0300 Subject: [PATCH] Release 0.2.1 (#12) * Release 0.1.5 * added retention_rules and storage_tier to buckets * updated README, updated sc vision example, added versioning check with retention rules, added precondition for storage_tier * added cursor options for sc streaming source; updated README and example * Revert "Merge branch 'issue-545-sch-bucket-retention-rules' into 'main'" This reverts merge request !12 * Release 0.1.6 * Release 0.1.7 * merge * remove tf version restriction * update terraform version in examples * fix freeform tags error * fix typo in service connectors readme * chore: release notes and version bump * doc: bucket_logs, flow_logs issue with compartment ids documented. Issue 557. * feat: module tag updated to ocilz-terraform-module * chore: release notes and SPECs updated * fix: handling spaces in log names * fix: time_sleep only when enabling oci_log_analytics_namespace * fix: tenancy_ocid variable added * chore: examples updated (variable and comments) * doc: updates * chore: example updated * feat: example for log group injection added * feat: log retention enforced to min of 90 days per CIS framework 8.10. In can be disabled setting enable_cis_checks to false * chore: release notes and version bump * fix: missing parenthesis added to SCH streaming policy * fix: extra parenthesis removed * chore: release notes and version increment * updated target-stream example files with oci.secondary_region provider references * fix: compartments logic added to compartment_id attribute in "oci_logging_unified_agent_configuration" "these" { for_each = var.logging_configuration.custom_log * chore: release notes and version increment --------- Co-authored-by: Erna Guerrero Co-authored-by: Rory Nguyen --- RELEASE-NOTES.md | 6 ++++++ logging/SPEC.md | 2 +- logging/main.tf | 2 +- logging/variables.tf | 1 + release.txt | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 2fb2a14..d5a07a2 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,9 @@ +# December 18, 2024 Release Notes - 0.2.1 + +## Updates +1. [Logging module](./logging/) + - Bug fix: *compartment_id* attribute added to *custom_logs* attribute and respective logic added to *oci_logging_unified_agent_configuration* resource for taking a literal OCID or a reference to an OCID. + # December 09, 2024 Release Notes - 0.2.0 ## Updates diff --git a/logging/SPEC.md b/logging/SPEC.md index 6f43151..6b96989 100644 --- a/logging/SPEC.md +++ b/logging/SPEC.md @@ -46,7 +46,7 @@ No modules. | [compartments\_dependency](#input\_compartments\_dependency) | A map of objects containing the externally managed compartments this module may depend on. All map objects must have the same type and must contain at least an 'id' attribute (representing the compartment OCID) of string type. |
map(object({
id = string
}))
| `null` | no | | [enable\_output](#input\_enable\_output) | Whether Terraform should enable module output. | `bool` | `true` | no | | [log\_groups\_dependency](#input\_log\_groups\_dependency) | A map of objects containing the externally managed log\_groups this module may depend on. All map objects must have the same type and must contain at least an 'id' attribute (representing the log group OCID) of string type. |
map(object({
id = string
}))
| `null` | no | -| [logging\_configuration](#input\_logging\_configuration) | Logging configuration settings, defining all aspects to manage logging in OCI. Please see the comments within each attribute for details. |
object({
enable_cis_checks = optional(bool,true), # Whether to enforce CIS benchmark and framework recommendations. Default is true.
default_compartment_id = string,
default_defined_tags = optional(map(string)),
default_freeform_tags = optional(map(string)),
onboard_logging_analytics = optional(bool),
log_groups = optional(map(object({
type = optional(string)
compartment_id = optional(string)
name = string
description = optional(string)
freeform_tags = optional(map(string))
defined_tags = optional(map(string))
})),{})
service_logs = optional(map(object({
name = string
log_group_id = string
service = string
category = string
resource_id = string
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
flow_logs = optional(map(object({
name_prefix = optional(string)
log_group_id = string
target_resource_type = string
target_compartment_ids = list(string)
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
bucket_logs = optional(map(object({
name_prefix = optional(string)
log_group_id = string
target_compartment_ids = list(string)
category = string
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
custom_logs = optional(map(object({
name = string
log_group_id = string
dynamic_groups = list(string)
parser_type = optional(string)
path = list(string)
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
})
| n/a | yes | +| [logging\_configuration](#input\_logging\_configuration) | Logging configuration settings, defining all aspects to manage logging in OCI. Please see the comments within each attribute for details. |
object({
enable_cis_checks = optional(bool,true), # Whether to enforce CIS benchmark and framework recommendations. Default is true.
default_compartment_id = string,
default_defined_tags = optional(map(string)),
default_freeform_tags = optional(map(string)),
onboard_logging_analytics = optional(bool),
log_groups = optional(map(object({
type = optional(string)
compartment_id = optional(string)
name = string
description = optional(string)
freeform_tags = optional(map(string))
defined_tags = optional(map(string))
})),{})
service_logs = optional(map(object({
name = string
log_group_id = string
service = string
category = string
resource_id = string
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
flow_logs = optional(map(object({
name_prefix = optional(string)
log_group_id = string
target_resource_type = string
target_compartment_ids = list(string)
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
bucket_logs = optional(map(object({
name_prefix = optional(string)
log_group_id = string
target_compartment_ids = list(string)
category = string
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
custom_logs = optional(map(object({
name = string
compartment_id = optional(string)
log_group_id = string
dynamic_groups = list(string)
parser_type = optional(string)
path = list(string)
is_enabled = optional(bool)
retention_duration = optional(number,90)
defined_tags = optional(map(string))
freeform_tags = optional(map(string))
})),{})
})
| n/a | yes | | [module\_name](#input\_module\_name) | The module name. | `string` | `"logging"` | no | | [tenancy\_ocid](#input\_tenancy\_ocid) | The tenancy OCID | `string` | `null` | no | diff --git a/logging/main.tf b/logging/main.tf index ce32bee..bf0d7f2 100644 --- a/logging/main.tf +++ b/logging/main.tf @@ -59,7 +59,7 @@ resource "oci_logging_log" "these_custom" { resource "oci_logging_unified_agent_configuration" "these" { for_each = var.logging_configuration.custom_logs != null ? var.logging_configuration.custom_logs : {} - compartment_id = each.value.compartment_id != null ? each.value.compartment_id : var.logging_configuration.default_compartment_id + compartment_id = each.value.compartment_id != null ? (length(regexall("^ocid1.*$", each.value.compartment_id)) > 0 ? each.value.compartment_id : var.compartments_dependency[each.value.compartment_id].id) : (length(regexall("^ocid1.*$", var.logging_configuration.default_compartment_id)) > 0 ? var.logging_configuration.default_compartment_id : var.compartments_dependency[var.logging_configuration.default_compartment_id].id) is_enabled = each.value.is_enabled description = format("%s%s", "Agent configuration for ", each.value.name) display_name = format("%s%s", "Agent_", each.value.name) diff --git a/logging/variables.tf b/logging/variables.tf index ef4cbb8..973b132 100644 --- a/logging/variables.tf +++ b/logging/variables.tf @@ -56,6 +56,7 @@ variable "logging_configuration" { })),{}) custom_logs = optional(map(object({ name = string + compartment_id = optional(string) log_group_id = string dynamic_groups = list(string) parser_type = optional(string) diff --git a/release.txt b/release.txt index 341cf11..7dff5b8 100644 --- a/release.txt +++ b/release.txt @@ -1 +1 @@ -0.2.0 \ No newline at end of file +0.2.1 \ No newline at end of file