Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Log Analysis instance sub-module

This sub-module supports provisioning the following observability instances:

  • IBM Cloud Logging with Log Analysis
    • Manage operating system logs, application logs, and platform logs in IBM Cloud.

ℹ️ This sub-module also creates a manager key, and supports passing COS bucket details to enable archiving for Log Analysis.

Usage

To provision Log Analysis instance

# required ibm provider config
provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key #pragma: allowlist secret
}

# required log analysis provider config
locals {
  at_endpoint = "https://api.${var.region}.logging.cloud.ibm.com"
}

provider "logdna" {
  alias      = "ld"
  servicekey = module.log_analysis.resource_key
  url        = local.at_endpoint
}

module "log_analysis" {
  source  = "terraform-ibm-modules/observability-instances/ibm//modules/log_analysis"
  version = "latest" # Replace "latest" with a release version to lock into a specific release
  providers = {
    logdna.ld = logdna.ld
  }
  resource_group_id = module.resource_group.resource_group_id
  region = var.region
}

Requirements

Name Version
terraform >= 1.0.0
ibm >= 1.56.1, < 2.0.0
logdna >= 1.14.2, < 2.0.0

Modules

No modules.

Resources

Name Type
ibm_resource_instance.log_analysis resource
ibm_resource_key.resource_key resource
ibm_resource_tag.log_analysis_tag resource
logdna_archive.archive_config resource

Inputs

Name Description Type Default Required
access_tags Access Management Tags associated with the IBM Cloud Logging instance (Optional, array of strings). list(string) [] no
cos_bucket_endpoint An endpoint for the COS bucket for the Log Analysis archive. Pass either the public or private endpoint. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true). string null no
cos_bucket_name The name of an existing COS bucket to be used for the Log Analysis archive. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true). string null no
cos_instance_id The ID of the cloud object storage instance containing the Log Analysis archive bucket. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true). string null no
enable_platform_logs Receive platform logs in the provisioned IBM Cloud Logging instance. bool true no
ibmcloud_api_key Only required to archive. The IBM Cloud API Key. string null no
instance_name The name of the IBM Cloud Logging instance to create. Defaults to 'log-analysis-' string null no
log_analysis_enable_archive Enable archive on Log Analysis instances bool false no
log_analysis_provision Provision an IBM Cloud Logging instance? bool true no
manager_key_name The name to give the IBM Cloud Logging manager key. string "LogDnaManagerKey" no
manager_key_tags Tags associated with the IBM Cloud Logging manager key. list(string) [] no
plan The IBM Cloud Logging plan to provision. Available: lite, 7-day, 14-day, 30-day, hipaa-30-day string "lite" no
region The IBM Cloud region where instances will be created. string "us-south" no
resource_group_id The id of the IBM Cloud resource group where the instance(s) will be created. string null no
resource_key_role Role assigned to provide the IBM Cloud Logging key. string "Manager" no
service_endpoints The type of the service endpoint that will be set for the Log Analysis instance. string "public-and-private" no
tags Tags associated with the IBM Cloud Logging instance (Optional, array of strings). list(string) [] no

Outputs

Name Description
crn The id of the provisioned Log Analysis instance.
guid The guid of the provisioned Log Analysis instance.
ingestion_key Log Analysis ingest key for agents to use
manager_key_name The Log Analysis manager key name
name The name of the provisioned Log Analysis instance.
resource_group_id The resource group where Log Analysis instance resides
resource_key Log Analysis service key for agents to use