Git Product home page Git Product logo

terraform-azurerm-diagnostic-settings's Introduction

Azure Diagnostic Settings

Changelog Notice Apache V2 License TF Registry

This module is based on work from Innovation Norway.

This Terraform enables the Diagnostic Settings on a given Azure resource.

Version compatibility

Module version Terraform version AzureRM version
>= 4.x.x 0.13.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Usage

You can use this module by including it this way:

data "azurerm_resources" "resources" {
  ...
}

resource "azurerm_storage_account" "logs" {
  ...
}

resource "azurerm_log_analytics_workspace" "logs" {
  ...
}

resource "azurerm_eventhub_namespace" "logs" {
  ...
}

resource "azurerm_eventhub" "logs" {
  ...
}

resource "azurerm_eventhub_authorization_rule" "logs" {
  ...
}

module "diagnostic-settings" {
  for_each = data.azurerm_resources.resources

  source  = "claranet/diagnostic-settings/azurerm"
  version = "x.x.x"

  resource_id = each.value.id

  logs_destinations_ids = [
    azurerm_storage_account.logs.id,
    azurerm_log_analytics_workspace.example.id,
    azurerm_eventhub_authorization_rule.logs.id,
  ]
  log_analytics_destination_type = "Dedicated"

}

Inputs

Name Description Type Default Required
eventhub_name Event Hub name if one of the destinations is an Event Hub. string null no
log_analytics_destination_type When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table. This only includes Azure Data Factory string "AzureDiagnostics" no
log_categories List of log categories. list(string) null no
logs_destinations_ids List of destination resources IDs for logs diagnostic destination. Can be Storage Account, Log Analytics Workspace and Event Hub. No more than one of each can be set. list(string) n/a yes
metric_categories List of metric categories. list(string) null no
name The name of the diagnostic setting. string "default" no
resource_id The ID of the resource on which activate the diagnostic settings. string n/a yes
retention_days The number of days to keep diagnostic logs. number 30 no

Outputs

Name Description
diagnostic_settings_id ID of the Diagnostic Settings.

Related documentation

Terraform documentation: terraform.io/docs/providers/azurerm/r/monitor_diagnostic_setting.html

terraform-azurerm-diagnostic-settings's People

Contributors

bzspi avatar jmapro avatar semantic-release-bot avatar shr3ps avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.