Skip to content

Commit

Permalink
release-0.1.2 (#3)
Browse files Browse the repository at this point in the history
* adding variables to repeat critical alarms

* adding variable for repeating critical alarms to vision/variables.tf

* updated alarms' repeated notifications

* doc: release updates

---------

Co-authored-by: Andre Correa <[email protected]>
Co-authored-by: Khushboo Nigam <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent ccd22a1 commit 3bad8a7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 3 deletions.
8 changes: 8 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# September 28, 2023 Release Notes - 0.1.2

## Updates
1. [Notification Frequency for Critical Alarms](#0-1-2-alarms)

### <a name="0-1-2-alarms">Notification Frequency for Critical Alarms</a>
Default notification frequency for critical alarms set to every 4 hours ("PT4H").

# August 04, 2023 Release Notes - 0.1.1

## Updates
Expand Down
2 changes: 1 addition & 1 deletion alarms/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alarms_configuration"></a> [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. | <pre>object({<br><br> 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.<br> default_defined_tags = optional(map(string)), # the default defined tags. It's overriden by the defined_tags attribute within each object.<br> default_freeform_tags = optional(map(string)), # the default freeform tags. It's overriden by the frreform_tags attribute within each object.<br><br> alarms = map(object({ # the alarms to manage in this configuration.<br> 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.<br> display_name = string # the alarm name.<br> is_enabled = optional(bool) # if the alarm is enabled. Default is true.<br> preconfigured_alarm_type = optional(string) # use a preconfigured alarm.<br> supplied_alarm = optional(object({<br> query = string # specify the query for the alarm. can't use the preconfigured_alarm_type attribute if this is set.<br> namespace = string # specify the namespace for the query. can't use the preconfigured_alarm_type attribute if this is set.<br> severity = optional(string) # response required when the alarm is in the "FIRING" state. Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO". Default is "CRITICAL".<br> pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M"<br> 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.<br> 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".<br> }))<br> 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. <br> 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. <br> defined_tags = optional(map(string)) # alarm defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # alarm freeform_tags. default_freeform_tags is used if undefined.<br> }))<br><br> topics = optional(map(object({ # the topics to manage in this configuration.<br> 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.<br> name = string # the topic name<br> description = optional(string) # the topic description<br> subscriptions = optional(list(object({<br> 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.<br> protocol = string # valid values (case insensitive): EMAIL, CUSTOM_HTTPS, PAGERDUTY, SLACK, ORACLE_FUNCTIONS, SMS<br> values = list(string) # list of endpoint values, specific to each protocol.<br> defined_tags = optional(map(string)) # subscription defined_tags. topic defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # subscription freeform_tags. topic freeform_tags is used if undefined.<br> })))<br> defined_tags = optional(map(string)) # topic defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # topic freeform_tags. default_freeform_tags is used if undefined.<br> })))<br><br> streams = optional(map(object({ # the streams to manage in this configuration.<br> 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.<br> name = string # the stream name<br> num_partitions = optional(number) # the number of stream partitions. Default is 1. <br> log_retention_in_hours = optional(number) # for how long to keep messages in the stream. Default is 24 hours.<br> defined_tags = optional(map(string)) # stream defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # stream freeform_tags. default_freeform_tags is used if undefined.<br> })))<br> })</pre> | n/a | yes |
| <a name="input_alarms_configuration"></a> [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. | <pre>object({<br><br> 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.<br> default_defined_tags = optional(map(string)), # the default defined tags. It's overriden by the defined_tags attribute within each object.<br> default_freeform_tags = optional(map(string)), # the default freeform tags. It's overriden by the frreform_tags attribute within each object.<br><br> alarms = map(object({ # the alarms to manage in this configuration.<br> 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.<br> display_name = string # the alarm name.<br> is_enabled = optional(bool) # if the alarm is enabled. Default is true.<br> preconfigured_alarm_type = optional(string) # use a preconfigured alarm.<br> supplied_alarm = optional(object({<br> query = string # specify the query for the alarm. can't use the preconfigured_alarm_type attribute if this is set.<br> namespace = string # specify the namespace for the query. can't use the preconfigured_alarm_type attribute if this is set.<br> severity = optional(string) # response required when the alarm is in the "FIRING" state. Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO". Default is "CRITICAL".<br> pending_duration = optional(string) # the period of time the condition must persist before the alarm is fired. Default is 5 minutes: "PT5M"<br> 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.<br> 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".<br> repeat_frequency_for_critical_alarms = optional(string) #option to repeat critical alarms<br> }))<br> 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. <br> 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. <br> defined_tags = optional(map(string)) # alarm defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # alarm freeform_tags. default_freeform_tags is used if undefined.<br> }))<br><br> topics = optional(map(object({ # the topics to manage in this configuration.<br> 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.<br> name = string # the topic name<br> description = optional(string) # the topic description<br> subscriptions = optional(list(object({<br> 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.<br> protocol = string # valid values (case insensitive): EMAIL, CUSTOM_HTTPS, PAGERDUTY, SLACK, ORACLE_FUNCTIONS, SMS<br> values = list(string) # list of endpoint values, specific to each protocol.<br> defined_tags = optional(map(string)) # subscription defined_tags. topic defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # subscription freeform_tags. topic freeform_tags is used if undefined.<br> })))<br> defined_tags = optional(map(string)) # topic defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # topic freeform_tags. default_freeform_tags is used if undefined.<br> })))<br><br> streams = optional(map(object({ # the streams to manage in this configuration.<br> 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.<br> name = string # the stream name<br> num_partitions = optional(number) # the number of stream partitions. Default is 1. <br> log_retention_in_hours = optional(number) # for how long to keep messages in the stream. Default is 24 hours.<br> defined_tags = optional(map(string)) # stream defined_tags. default_defined_tags is used if undefined.<br> freeform_tags = optional(map(string)) # stream freeform_tags. default_freeform_tags is used if undefined.<br> })))<br> })</pre> | n/a | yes |
| <a name="input_compartments_dependency"></a> [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 |
| <a name="input_enable_output"></a> [enable\_output](#input\_enable\_output) | Whether Terraform should enable the module output. | `bool` | `true` | no |
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | The module name. | `string` | `"alarms"` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["<REPLACE-BY-TOPIC-REFERENCE>"]
}
Expand Down
1 change: 1 addition & 0 deletions alarms/examples/supplied_alarms/input.auto.tfvars.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ alarms_configuration = {
metric_compartment_ocid = "<REPLACE-BY-METRIC-COMPARTMENT-OCID>"
severity = "CRITICAL"
message_format = "ONS_OPTIMIZED"
repeat_frequency_for_critical_alarms = "PT4H" # 4 hours
}
destination_topic_ids = ["<REPLACE-BY-TOPIC-OCID>"]
#defined_tags = null
Expand Down
1 change: 1 addition & 0 deletions alarms/examples/supplied_alarms/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion alarms/examples/vision/input.auto.tfvars.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

tenancy_ocid = "<tenancy OCID>" # Get this from OCI Console (after logging in, go to top-right-most menu item and click option "Tenancy: <your tenancy name>").
user_ocid = "<user OCID>" # Get this from OCI Console (after logging in, go to top-right-most menu item and click option "My profile").
fingerprint = "<PEM key 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 = "<PEM key 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 = "<path to the private key>" # 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 = "<your tenancy region>" # This is your region, where all other events are created. It can be the same as home_region.
Expand Down
1 change: 1 addition & 0 deletions alarms/examples/vision/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions alarms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading

0 comments on commit 3bad8a7

Please sign in to comment.