Skip to content

Commit

Permalink
feat: added support to enable platform logs in cloud logs region usin…
Browse files Browse the repository at this point in the history
…g boolean (#171)
  • Loading branch information
ocofaigh authored Sep 30, 2024
1 parent 5c849c7 commit c9c904a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
15 changes: 6 additions & 9 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@
}
]
},
{
"key": "enable_platform_logs"
},
{
"key": "logs_routing_tenant_regions"
},
{
"key": "existing_en_instance_crn"
},
Expand All @@ -216,9 +222,6 @@
{
"key": "skip_logs_routing_auth_policy"
},
{
"key": "logs_routing_tenant_regions"
},
{
"key": "log_analysis_provision"
},
Expand Down Expand Up @@ -276,9 +279,6 @@
{
"key": "log_archive_api_key"
},
{
"key": "enable_platform_logs"
},
{
"key": "enable_at_event_routing_to_log_analysis"
},
Expand Down Expand Up @@ -313,9 +313,6 @@
{
"key": "cloud_monitoring_tags"
},
{
"key": "enable_platform_metrics"
},
{
"key": "cos_instance_name"
},
Expand Down
6 changes: 3 additions & 3 deletions solutions/instances/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
This deployable architecture creates observability instances in IBM Cloud and supports provisioning the following resources:

* A resource group, if one is not passed in.
* An IBM Cloud Log Analysis instance.
* An IBM Cloud Log Analysis instance (Disabled by default as service is deprecated)
* An IBM Cloud Monitoring instance.
* An IBM Cloud Logs instance.
* An IBM Cloud Object Storage instance, if one does not exist.
* The root keys in an existing key management service (KMS) if the keys do not exist. These keys are used when Object Storage buckets are created.
* A KMS-encrypted Object Storage bucket to store archived logs, if one is not passed in.
* A KMS-encrypted Object Storage bucket for Activity Tracker event routing, if one is not passed in.
* A KMS-encrypted Object Storage bucket for Activity Tracker event routing, if one is not passed in. (Disabled by default as service is deprecated)
* A KMS-encrypted Object Storage bucket for Cloud Logs data, if one is not passed in.
* An Activity Tracker event route to an Object Storage, Log Analysis and Cloud Logs target.
* An Activity Tracker event route to an Object Storage bucket and Cloud Logs target.
* An option to integrate Cloud Logs with existing event notification instance.

![observability-instances-deployable-architecture](../../reference-architecture/deployable-architecture-observability-instances.svg)
Expand Down
4 changes: 2 additions & 2 deletions solutions/instances/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ locals {

module "observability_instance" {
source = "terraform-ibm-modules/observability-instances/ibm"
version = "2.18.0"
version = "2.19.1"
providers = {
logdna.at = logdna.at
logdna.ld = logdna.ld
Expand Down Expand Up @@ -179,7 +179,7 @@ module "observability_instance" {
bucket_endpoint = var.existing_cloud_logs_data_bucket_endpoint != null ? var.existing_cloud_logs_data_bucket_endpoint : module.cos_bucket[0].buckets[local.cloud_log_data_bucket].s3_endpoint_direct
},
metrics_data = {
enabled = false # Support for metrics is dependent on the resolution of https://github.com/terraform-ibm-modules/terraform-ibm-observability-instances/issues/555
enabled = false # Support tracked in https://github.com/terraform-ibm-modules/terraform-ibm-observability-da/issues/170
bucket_crn = null
bucket_endpoint = null
}
Expand Down
25 changes: 13 additions & 12 deletions solutions/instances/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ variable "skip_logs_routing_auth_policy" {
default = false
}

variable "enable_platform_logs" {
type = bool
description = "Setting this to true will create a tenant in the same region that the Cloud Logs instance is provisioned to enable platform logs for that region. To send platform logs from other regions, you can explicitially specify a list of regions using the `logs_routing_tenant_regions` input. NOTE: You can only have 1 tenant per region in an account. If `log_analysis_provision` is set to true, this variable will also enable platform logs for the Log analysis instance."
default = true
}

variable "logs_routing_tenant_regions" {
type = list(any)
default = []
Expand All @@ -160,20 +166,20 @@ variable "logs_routing_tenant_regions" {
##############################################################################

variable "log_analysis_provision" {
description = "Set it to true to provision an IBM Cloud Logging instance. IBM Cloud Log Analysis is now deprecated and new instances cannot be provisioned after November 30, 2024, and all existing instances will be destroyed on March 30, 2025. For more information, see https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-getting-started"
description = "DEPRECATED: Set it to true to provision an IBM Cloud Logging instance. IBM Cloud Log Analysis is now deprecated and new instances cannot be provisioned after November 30, 2024, and all existing instances will be destroyed on March 30, 2025. For more information, see https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-getting-started"
type = bool
default = false
}

variable "log_analysis_instance_name" {
type = string
description = "The name of the IBM Cloud Log Analysis instance to create. If a prefix input variable is specified, it's added to the value in the <prefix>-value format."
description = "DEPRECATED: The name of the IBM Cloud Log Analysis instance to create. If a prefix input variable is specified, it's added to the value in the <prefix>-value format."
default = "log-analysis"
}

variable "log_analysis_plan" {
type = string
description = "The Log Analysis plan to provision. Possible values: `7-day`, `14-day`, `30-day`, and `hipaa-30-day`."
description = "DEPRECATED: The Log Analysis plan to provision. Possible values: `7-day`, `14-day`, `30-day`, and `hipaa-30-day`."
default = "7-day"

validation {
Expand All @@ -183,7 +189,7 @@ variable "log_analysis_plan" {
}

variable "log_analysis_service_endpoints" {
description = "The type of endpoint for the Log Analysis instance. Possible values: `public`, `private`, `public-and-private`."
description = "DEPRECATED: The type of endpoint for the Log Analysis instance. Possible values: `public`, `private`, `public-and-private`."
type = string
default = "private"
validation {
Expand All @@ -194,28 +200,23 @@ variable "log_analysis_service_endpoints" {

variable "log_analysis_tags" {
type = list(string)
description = "The tags that are associated with the IBM Cloud Logging instance (`Optional`, `array of strings`)."
description = "DEPRECATED: The tags that are associated with the IBM Cloud Logging instance (`Optional`, `array of strings`)."
default = []
}

variable "log_analysis_enable_archive" {
type = bool
description = "Whether to enable archiving on Log Analysis instances. If set to true, `log_analysis_provision` must also be set to true."
description = "DEPRECATED: Whether to enable archiving on Log Analysis instances. If set to true, `log_analysis_provision` must also be set to true."
default = true
}

variable "log_archive_api_key" {
type = string
description = "The API key to use to configure archiving from Log Analysis to Object Storage. If not specified, the API key value in ibmcloud_api_key is used."
description = "DEPRECATED: The API key to use to configure archiving from Log Analysis to Object Storage. If not specified, the API key value in ibmcloud_api_key is used."
sensitive = true
default = null
}

variable "enable_platform_logs" {
type = bool
description = "Whether Log Analysis collects platform log files."
default = true
}
##############################################################################
# Activity Tracker Event Routing Variables
##############################################################################
Expand Down

0 comments on commit c9c904a

Please sign in to comment.