diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 5760c48..29f1835 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,11 @@ +# September 28, 2023 Release Notes - 0.1.2 + +## Updates +1. [Notification Frequency for Critical Alarms](#0-1-2-alarms) + +### Notification Frequency for Critical Alarms +Default notification frequency for critical alarms set to every 4 hours ("PT4H"). + # August 04, 2023 Release Notes - 0.1.1 ## Updates diff --git a/alarms/SPEC.md b/alarms/SPEC.md index c4c50f7..9b409cd 100644 --- a/alarms/SPEC.md +++ b/alarms/SPEC.md @@ -27,7 +27,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [alarms\_configuration](#input\_alarms\_configuration) | Alarms configuration settings, defining all aspects to manage alarms in OCI. Please see the comments within each attribute for details. |
object({

default_compartment_id = string, # the default compartment where all resources are defined. It's overriden by the compartment_id attribute within each object. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
default_defined_tags = optional(map(string)), # the default defined tags. It's overriden by the defined_tags attribute within each object.
default_freeform_tags = optional(map(string)), # the default freeform tags. It's overriden by the frreform_tags attribute within each object.

alarms = map(object({ # the alarms to manage in this configuration.
compartment_id = optional(string) # the compartment where the alarm is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
display_name = string # the alarm name.
is_enabled = optional(bool) # if the alarm is enabled. Default is true.
preconfigured_alarm_type = optional(string) # use a preconfigured alarm.
supplied_alarm = optional(object({
query = string # specify the query for the alarm. can't use the preconfigured_alarm_type attribute if this is set.
namespace = string # specify the namespace for the query. can't use the preconfigured_alarm_type attribute if this is set.
severity = optional(string) # response required when the alarm is in the "FIRING" state. Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO". Default is "CRITICAL".
pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M"
metric_compartment_id = optional(string) # the compartment containing the metric being evaluated by the alarm. compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
message_format = optional(string) # format to use for notification messages sent from this alarm. Valid formats are: "RAW", "PRETTY_JSON", "ONS_OPTIMIZED". Default is "PRETTY_JSON".
}))
destination_topic_ids = optional(list(string)) # List of topics to send alarms to. This attribute is overloaded: values can be either topic OCIDs or references (keys) to the topics OCIDs. The references are first looked up in the topics attribute and then in the topics_dependency object.
destination_stream_ids = optional(list(string)) # List of streams to send alarms to. This attribute is overloaded: values can be either stream OCIDs or references (keys) to the streams OCIDs. The references are first looked up in the streams attribute and then in the streams_dependency object.
defined_tags = optional(map(string)) # alarm defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # alarm freeform_tags. default_freeform_tags is used if undefined.
}))

topics = optional(map(object({ # the topics to manage in this configuration.
compartment_id = optional(string) # the compartment where the topic is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
name = string # the topic name
description = optional(string) # the topic description
subscriptions = optional(list(object({
compartment_id = optional(string) # the compartment where the subscription is created. Topic compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
protocol = string # valid values (case insensitive): EMAIL, CUSTOM_HTTPS, PAGERDUTY, SLACK, ORACLE_FUNCTIONS, SMS
values = list(string) # list of endpoint values, specific to each protocol.
defined_tags = optional(map(string)) # subscription defined_tags. topic defined_tags is used if undefined.
freeform_tags = optional(map(string)) # subscription freeform_tags. topic freeform_tags is used if undefined.
})))
defined_tags = optional(map(string)) # topic defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # topic freeform_tags. default_freeform_tags is used if undefined.
})))

streams = optional(map(object({ # the streams to manage in this configuration.
compartment_id = optional(string) # the compartment where the stream is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
name = string # the stream name
num_partitions = optional(number) # the number of stream partitions. Default is 1.
log_retention_in_hours = optional(number) # for how long to keep messages in the stream. Default is 24 hours.
defined_tags = optional(map(string)) # stream defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # stream freeform_tags. default_freeform_tags is used if undefined.
})))
})
| n/a | yes | +| [alarms\_configuration](#input\_alarms\_configuration) | Alarms configuration settings, defining all aspects to manage alarms in OCI. Please see the comments within each attribute for details. |
object({

default_compartment_id = string, # the default compartment where all resources are defined. It's overriden by the compartment_id attribute within each object. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
default_defined_tags = optional(map(string)), # the default defined tags. It's overriden by the defined_tags attribute within each object.
default_freeform_tags = optional(map(string)), # the default freeform tags. It's overriden by the frreform_tags attribute within each object.

alarms = map(object({ # the alarms to manage in this configuration.
compartment_id = optional(string) # the compartment where the alarm is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
display_name = string # the alarm name.
is_enabled = optional(bool) # if the alarm is enabled. Default is true.
preconfigured_alarm_type = optional(string) # use a preconfigured alarm.
supplied_alarm = optional(object({
query = string # specify the query for the alarm. can't use the preconfigured_alarm_type attribute if this is set.
namespace = string # specify the namespace for the query. can't use the preconfigured_alarm_type attribute if this is set.
severity = optional(string) # response required when the alarm is in the "FIRING" state. Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO". Default is "CRITICAL".
pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M"
metric_compartment_id = optional(string) # the compartment containing the metric being evaluated by the alarm. compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
message_format = optional(string) # format to use for notification messages sent from this alarm. Valid formats are: "RAW", "PRETTY_JSON", "ONS_OPTIMIZED". Default is "PRETTY_JSON".
repeat_frequency_for_critical_alarms = optional(string) #option to repeat critical alarms
}))
destination_topic_ids = optional(list(string)) # List of topics to send alarms to. This attribute is overloaded: values can be either topic OCIDs or references (keys) to the topics OCIDs. The references are first looked up in the topics attribute and then in the topics_dependency object.
destination_stream_ids = optional(list(string)) # List of streams to send alarms to. This attribute is overloaded: values can be either stream OCIDs or references (keys) to the streams OCIDs. The references are first looked up in the streams attribute and then in the streams_dependency object.
defined_tags = optional(map(string)) # alarm defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # alarm freeform_tags. default_freeform_tags is used if undefined.
}))

topics = optional(map(object({ # the topics to manage in this configuration.
compartment_id = optional(string) # the compartment where the topic is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
name = string # the topic name
description = optional(string) # the topic description
subscriptions = optional(list(object({
compartment_id = optional(string) # the compartment where the subscription is created. Topic compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
protocol = string # valid values (case insensitive): EMAIL, CUSTOM_HTTPS, PAGERDUTY, SLACK, ORACLE_FUNCTIONS, SMS
values = list(string) # list of endpoint values, specific to each protocol.
defined_tags = optional(map(string)) # subscription defined_tags. topic defined_tags is used if undefined.
freeform_tags = optional(map(string)) # subscription freeform_tags. topic freeform_tags is used if undefined.
})))
defined_tags = optional(map(string)) # topic defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # topic freeform_tags. default_freeform_tags is used if undefined.
})))

streams = optional(map(object({ # the streams to manage in this configuration.
compartment_id = optional(string) # the compartment where the stream is created. default_compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID.
name = string # the stream name
num_partitions = optional(number) # the number of stream partitions. Default is 1.
log_retention_in_hours = optional(number) # for how long to keep messages in the stream. Default is 24 hours.
defined_tags = optional(map(string)) # stream defined_tags. default_defined_tags is used if undefined.
freeform_tags = optional(map(string)) # stream freeform_tags. default_freeform_tags is used if undefined.
})))
})
| n/a | yes | | [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(any)` | `null` | no | | [enable\_output](#input\_enable\_output) | Whether Terraform should enable the module output. | `bool` | `true` | no | | [module\_name](#input\_module\_name) | The module name. | `string` | `"alarms"` | no | diff --git a/alarms/examples/external-dependency/input.auto.tfvars.template b/alarms/examples/external-dependency/input.auto.tfvars.template index f760f58..3916612 100644 --- a/alarms/examples/external-dependency/input.auto.tfvars.template +++ b/alarms/examples/external-dependency/input.auto.tfvars.template @@ -44,6 +44,7 @@ alarms_configuration = { metric_compartment_id = "APP-CMP" severity = "CRITICAL" message_format = "PRETTY_JSON" + repeat_frequency_for_critical_alarms = "PT4H" # 4 hours } destination_topic_ids = [""] } diff --git a/alarms/examples/supplied_alarms/input.auto.tfvars.template b/alarms/examples/supplied_alarms/input.auto.tfvars.template index 7424d1e..908b13d 100644 --- a/alarms/examples/supplied_alarms/input.auto.tfvars.template +++ b/alarms/examples/supplied_alarms/input.auto.tfvars.template @@ -40,6 +40,7 @@ alarms_configuration = { metric_compartment_ocid = "" severity = "CRITICAL" message_format = "ONS_OPTIMIZED" + repeat_frequency_for_critical_alarms = "PT4H" # 4 hours } destination_topic_ids = [""] #defined_tags = null diff --git a/alarms/examples/supplied_alarms/variables.tf b/alarms/examples/supplied_alarms/variables.tf index 2689ef2..93a65b1 100644 --- a/alarms/examples/supplied_alarms/variables.tf +++ b/alarms/examples/supplied_alarms/variables.tf @@ -28,6 +28,7 @@ variable "alarms_configuration" { pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M" metric_compartment_id = optional(string) # the compartment containing the metric being evaluated by the alarm. compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID. message_format = optional(string) # format to use for notification messages sent from this alarm. Valid formats are: "RAW", "PRETTY_JSON", "ONS_OPTIMIZED". Default is "PRETTY_JSON". + repeat_notification_critical_alarms = optional(string) #option to repeat critical alarms })) destination_topic_ids = optional(list(string)) # List of topics to send alarms to. This attribute is overloaded: values can be either topic OCIDs or references (keys) to the topics OCIDs. The references are first looked up in the topics attribute and then in the topics_dependency object. destination_stream_ids = optional(list(string)) # List of streams to send alarms to. This attribute is overloaded: values can be either stream OCIDs or references (keys) to the streams OCIDs. The references are first looked up in the streams attribute and then in the streams_dependency object. diff --git a/alarms/examples/vision/input.auto.tfvars.template b/alarms/examples/vision/input.auto.tfvars.template index 959bd30..2623e10 100644 --- a/alarms/examples/vision/input.auto.tfvars.template +++ b/alarms/examples/vision/input.auto.tfvars.template @@ -14,7 +14,7 @@ tenancy_ocid = "" # Get this from OCI Console (after logging in, go to top-right-most menu item and click option "Tenancy: "). user_ocid = "" # Get this from OCI Console (after logging in, go to top-right-most menu item and click option "My profile"). -fingerprint = "" # The fingerprint can be gathered from your user account. In the "My profile page, click "API keys" on the menu in left hand side. +fingerprint = "" # The fingerprint can be gathered from your user account. In the "My profile page, click "API keys" on the menu in left hand side). private_key_path = "" # This is the full path on your local system to the API signing private key. private_key_password = "" # This is the password that protects the private key, if any. region = "" # This is your region, where all other events are created. It can be the same as home_region. diff --git a/alarms/examples/vision/variables.tf b/alarms/examples/vision/variables.tf index 554a0ce..85f7b30 100644 --- a/alarms/examples/vision/variables.tf +++ b/alarms/examples/vision/variables.tf @@ -28,6 +28,7 @@ variable "alarms_configuration" { pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M" metric_compartment_id = optional(string) # the compartment containing the metric being evaluated by the alarm. compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID. message_format = optional(string) # format to use for notification messages sent from this alarm. Valid formats are: "RAW", "PRETTY_JSON", "ONS_OPTIMIZED". Default is "PRETTY_JSON". + repeat_notification_critical_alarms = optional(string) #option to repeat critical alarms })) destination_topic_ids = optional(list(string)) # List of topics to send alarms to. This attribute is overloaded: values can be either topic OCIDs or references (keys) to the topics OCIDs. The references are first looked up in the topics attribute and then in the topics_dependency object. destination_stream_ids = optional(list(string)) # List of streams to send alarms to. This attribute is overloaded: values can be either stream OCIDs or references (keys) to the streams OCIDs. The references are first looked up in the streams attribute and then in the streams_dependency object. diff --git a/alarms/main.tf b/alarms/main.tf index 8598000..80de3aa 100644 --- a/alarms/main.tf +++ b/alarms/main.tf @@ -45,6 +45,7 @@ resource "oci_monitoring_alarm" "these" { severity = each.value.supplied_alarm != null ? each.value.supplied_alarm.severity != null ? each.value.supplied_alarm.severity : "CRITICAL" : local.preconfigured_alarms[each.value.preconfigured_alarm_type].severity pending_duration = each.value.supplied_alarm != null ? each.value.supplied_alarm.pending_duration != null ? each.value.supplied_alarm.pending_duration : "PT5M" : local.preconfigured_alarms[each.value.preconfigured_alarm_type].pending_duration message_format = each.value.supplied_alarm != null ? each.value.supplied_alarm.message_format != null ? each.value.supplied_alarm.message_format : "PRETTY_JSON" : local.preconfigured_alarms[each.value.preconfigured_alarm_type].message_format + repeat_notification_duration = each.value.supplied_alarm != null ? each.value.supplied_alarm.severity != null ? (each.value.supplied_alarm.severity == "CRITICAL" ? (each.value.supplied_alarm.repeat_notification_critical_alarms != null ? each.value.supplied_alarm.repeat_notification_critical_alarms : "PT4H") : each.value.supplied_alarm.repeat_notification_critical_alarms) : "PT4H" : local.preconfigured_alarms[each.value.preconfigured_alarm_type].repeat_notification_critical_alarms defined_tags = each.value.defined_tags != null ? each.value.defined_tags : var.alarms_configuration.default_defined_tags freeform_tags = merge(local.cislz_module_tag, each.value.freeform_tags != null ? each.value.freeform_tags : var.alarms_configuration.default_freeform_tags) } diff --git a/alarms/preconfigured_alarms.tf b/alarms/preconfigured_alarms.tf index adceff0..3f9da08 100644 --- a/alarms/preconfigured_alarms.tf +++ b/alarms/preconfigured_alarms.tf @@ -9,6 +9,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } instance-status-alarm = { namespace = "oci_compute_infrastructure_health" @@ -16,6 +17,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } vm-maintenance-alarm = { namespace = "oci_compute_infrastructure_health" @@ -23,6 +25,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } bare-metal-unhealthy-alarm = { namespace = "oci_compute_infrastructure_health" @@ -30,6 +33,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } high-memory-alarm = { namespace = "oci_computeagent" @@ -37,6 +41,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } adb-cpu-alarm = { namespace = "oci_autonomous_database" @@ -44,6 +49,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } adb-storage-alarm = { namespace = "oci_autonomous_database" @@ -51,6 +57,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } vpn-status-alarm = { namespace = "oci_vpn" @@ -58,6 +65,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } fast-connect-status-alarm = { namespace = "oci_fastconnect" @@ -65,6 +73,7 @@ locals { severity = "CRITICAL" message_format = "PRETTY_JSON" pending_duration = "PT5M" + repeat_notification_critical_alarms = "PT4H" } } diff --git a/alarms/variables.tf b/alarms/variables.tf index d37a4d8..02238d9 100644 --- a/alarms/variables.tf +++ b/alarms/variables.tf @@ -21,6 +21,7 @@ variable "alarms_configuration" { pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M" metric_compartment_id = optional(string) # the compartment containing the metric being evaluated by the alarm. compartment_id is used if undefined. This attribute is overloaded: it can be either a compartment OCID or a reference (a key) to the compartment OCID. message_format = optional(string) # format to use for notification messages sent from this alarm. Valid formats are: "RAW", "PRETTY_JSON", "ONS_OPTIMIZED". Default is "PRETTY_JSON". + repeat_frequency_for_critical_alarms = optional(string) #option to repeat critical alarms })) destination_topic_ids = optional(list(string)) # List of topics to send alarms to. This attribute is overloaded: values can be either topic OCIDs or references (keys) to the topics OCIDs. The references are first looked up in the topics attribute and then in the topics_dependency object. destination_stream_ids = optional(list(string)) # List of streams to send alarms to. This attribute is overloaded: values can be either stream OCIDs or references (keys) to the streams OCIDs. The references are first looked up in the streams attribute and then in the streams_dependency object. diff --git a/release.txt b/release.txt index 6da28dd..8294c18 100644 --- a/release.txt +++ b/release.txt @@ -1 +1 @@ -0.1.1 \ No newline at end of file +0.1.2 \ No newline at end of file