Skip to content

Latest commit

 

History

History
141 lines (112 loc) · 2.32 KB

datadog_logs_index.md

File metadata and controls

141 lines (112 loc) · 2.32 KB

datadog_logs_index

back

Index

Terraform

terraform {
  required_providers {
    datadog = ">= 2.24.0"
  }
}

top

Example Usage

module "datadog_logs_index" {
  source = "./modules/datadog/r/datadog_logs_index"

  # name - (required) is a type of string
  name = null

  exclusion_filter = [{
    filter = [{
      query       = null
      sample_rate = null
    }]
    is_enabled = null
    name       = null
  }]

  filter = [{
    query = null
  }]
}

top

Variables

variable "name" {
  description = "(required) - The name of the index."
  type        = string
}

variable "exclusion_filter" {
  description = "nested block: NestingList, min items: 0, max items: 0"
  type = set(object(
    {
      filter = list(object(
        {
          query       = string
          sample_rate = number
        }
      ))
      is_enabled = bool
      name       = string
    }
  ))
  default = []
}

variable "filter" {
  description = "nested block: NestingList, min items: 1, max items: 0"
  type = set(object(
    {
      query = string
    }
  ))
}

top

Resource

resource "datadog_logs_index" "this" {
  # name - (required) is a type of string
  name = var.name

  dynamic "exclusion_filter" {
    for_each = var.exclusion_filter
    content {
      # is_enabled - (optional) is a type of bool
      is_enabled = exclusion_filter.value["is_enabled"]
      # name - (optional) is a type of string
      name = exclusion_filter.value["name"]

      dynamic "filter" {
        for_each = exclusion_filter.value.filter
        content {
          # query - (optional) is a type of string
          query = filter.value["query"]
          # sample_rate - (optional) is a type of number
          sample_rate = filter.value["sample_rate"]
        }
      }

    }
  }

  dynamic "filter" {
    for_each = var.filter
    content {
      # query - (required) is a type of string
      query = filter.value["query"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = datadog_logs_index.this.id
}

output "this" {
  value = datadog_logs_index.this
}

top