back
terraform {
required_providers {
datadog = ">= 2.24.0"
}
}
top
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
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 "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
output "id" {
description = "returns a string"
value = datadog_logs_index.this.id
}
output "this" {
value = datadog_logs_index.this
}
top