Skip to content

This terraform module is designed to create Azure Log Analytics resources. What is Azure Log Analytics Workspace? Serverless360 An Azure Log Analytics Workspace is a logical storage unit in Azure where all log data generated by Azure Monitors are stored.

License

Notifications You must be signed in to change notification settings

clouddrove/terraform-azure-log-analytics

Terraform AZURE LOG-ANALYTICS

Terraform module to create LOG-ANALYTICS resource on AZURE.

Terraform Licence


Prerequisites

This module has a few dependencies:

IMPORTANT: Since the master branch used in source varies based on new modifications, we suggest that you use the release versions here.

Simple Example

Here is an example of how you can use this module in your inventory structure:

module "log-analytics" {
 source                           = "clouddrove/log-analytics/azure"
 name                             = "app"
 environment                      = "test"
 label_order                      = ["name", "environment"]
 resource_group_name              = module.resource_group.resource_group_name
 log_analytics_workspace_location = module.resource_group.resource_group_location

 #### diagnostic setting
 log_analytics_workspace_id       = module.log-analytics.workspace_id
 }

Inputs

Name Description Type Default Required
Metric_enable Is this Diagnostic Metric enabled? Defaults to true. bool true no
category The name of a Diagnostic Log Category Group for this Resource. string null no
create_log_analytics_workspace The Flag for Module Enable or Disabled if it will false it will take existing_log_analytics_workspace. bool true no
daily_quota_gb The workspace daily quota for ingestion in GB. Defaults to -1 (unlimited) if omitted. string "-1" no
days The number of days for which this Retention Policy should apply. number "90" no
diagnostic_setting_enable n/a bool true no
email_receiver One or more email_receiver blocks as defined below. list(any) [] no
enabled Set to false to prevent the module from creating any resources. bool true no
environment Environment (e.g. prod, dev, staging). string "" no
eventhub_authorization_rule_id Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. string null no
eventhub_name Specifies the name of the Event Hub where Diagnostics Data should be sent. string null no
internet_ingestion_enabled Should the Log Analytics Workspace support ingestion over the Public Internet? Defaults to true. bool true no
internet_query_enabled Should the Log Analytics Workspace support querying over the Public Internet? Defaults to true. bool true no
label_order Label order, e.g. sequence of application name and environment name,environment,'attribute' [webserver,qa,devops,public,] . list(any)
[
"name",
"environment"
]
no
log_analytics_destination_type Possible values are AzureDiagnostics and Dedicated, default to AzureDiagnostics. When set to Dedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table. string "AzureDiagnostics" no
log_analytics_workspace_id n/a string null no
log_analytics_workspace_location Location of the Workspace string "West Us" no
log_analytics_workspace_name Name of the Log Analytics Workspace string "loganalytics" no
log_analytics_workspace_sku pecifies the Sku of the Log Analytics Workspace. Possible values are Free, PerNode, Premium, Standard, Standalone, Unlimited, CapacityReservation, and PerGB2018 (new Sku as of 2018-04-03). Defaults to PerGB2018 string "PerGB2018" no
log_enabled Is this Diagnostic Log enabled? Defaults to true. string true no
managedby ManagedBy, eg ''. string "" no
name Name (e.g. app or cluster). string "" no
repository Terraform current module repo string "" no
resource_group_name Resource group of deployment string "" no
retention_in_days The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730. number null no
retention_policy_enabled Is this Retention Policy enabled? bool false no
scheduled_query_rules_alert Manages an AlertingAction Scheduled Query Rules resource within Azure Monitor. any {} no
storage_account_id The ID of the Storage Account where logs should be sent. string null no
tags A map of tags to add to all resources map(string) {} no

Outputs

Name Description
workspace_customer_id n/a
workspace_id n/a

Feedback

If you come accross a bug or have any feedback, please log it in our issue tracker, or feel free to drop us an email at hello@clouddrove.com.

If you have found it worth your time, go ahead and give us a ★ on our GitHub!

About us

At CloudDrove, we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.

We are The Cloud Experts!


We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

About

This terraform module is designed to create Azure Log Analytics resources. What is Azure Log Analytics Workspace? Serverless360 An Azure Log Analytics Workspace is a logical storage unit in Azure where all log data generated by Azure Monitors are stored.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published