Skip to content

Latest commit

 

History

History
323 lines (273 loc) · 7.35 KB

azurerm_api_management_diagnostic.md

File metadata and controls

323 lines (273 loc) · 7.35 KB

azurerm_api_management_diagnostic

back

Index

Terraform

terraform {
  required_providers {
    azurerm = ">= 2.54.0"
  }
}

top

Example Usage

module "azurerm_api_management_diagnostic" {
  source = "./modules/azurerm/r/azurerm_api_management_diagnostic"

  # always_log_errors - (optional) is a type of bool
  always_log_errors = null
  # api_management_logger_id - (required) is a type of string
  api_management_logger_id = null
  # api_management_name - (required) is a type of string
  api_management_name = null
  # enabled - (optional) is a type of bool
  enabled = null
  # http_correlation_protocol - (optional) is a type of string
  http_correlation_protocol = null
  # identifier - (required) is a type of string
  identifier = null
  # log_client_ip - (optional) is a type of bool
  log_client_ip = null
  # resource_group_name - (required) is a type of string
  resource_group_name = null
  # sampling_percentage - (optional) is a type of number
  sampling_percentage = null
  # verbosity - (optional) is a type of string
  verbosity = null

  backend_request = [{
    body_bytes     = null
    headers_to_log = []
  }]

  backend_response = [{
    body_bytes     = null
    headers_to_log = []
  }]

  frontend_request = [{
    body_bytes     = null
    headers_to_log = []
  }]

  frontend_response = [{
    body_bytes     = null
    headers_to_log = []
  }]

  timeouts = [{
    create = null
    delete = null
    read   = null
    update = null
  }]
}

top

Variables

variable "always_log_errors" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "api_management_logger_id" {
  description = "(required)"
  type        = string
}

variable "api_management_name" {
  description = "(required)"
  type        = string
}

variable "enabled" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "http_correlation_protocol" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "identifier" {
  description = "(required)"
  type        = string
}

variable "log_client_ip" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "resource_group_name" {
  description = "(required)"
  type        = string
}

variable "sampling_percentage" {
  description = "(optional)"
  type        = number
  default     = null
}

variable "verbosity" {
  description = "(optional)"
  type        = string
  default     = null
}

variable "backend_request" {
  description = "nested block: NestingList, min items: 0, max items: 1"
  type = set(object(
    {
      body_bytes     = number
      headers_to_log = set(string)
    }
  ))
  default = []
}

variable "backend_response" {
  description = "nested block: NestingList, min items: 0, max items: 1"
  type = set(object(
    {
      body_bytes     = number
      headers_to_log = set(string)
    }
  ))
  default = []
}

variable "frontend_request" {
  description = "nested block: NestingList, min items: 0, max items: 1"
  type = set(object(
    {
      body_bytes     = number
      headers_to_log = set(string)
    }
  ))
  default = []
}

variable "frontend_response" {
  description = "nested block: NestingList, min items: 0, max items: 1"
  type = set(object(
    {
      body_bytes     = number
      headers_to_log = set(string)
    }
  ))
  default = []
}

variable "timeouts" {
  description = "nested block: NestingSingle, min items: 0, max items: 0"
  type = set(object(
    {
      create = string
      delete = string
      read   = string
      update = string
    }
  ))
  default = []
}

top

Resource

resource "azurerm_api_management_diagnostic" "this" {
  # always_log_errors - (optional) is a type of bool
  always_log_errors = var.always_log_errors
  # api_management_logger_id - (required) is a type of string
  api_management_logger_id = var.api_management_logger_id
  # api_management_name - (required) is a type of string
  api_management_name = var.api_management_name
  # enabled - (optional) is a type of bool
  enabled = var.enabled
  # http_correlation_protocol - (optional) is a type of string
  http_correlation_protocol = var.http_correlation_protocol
  # identifier - (required) is a type of string
  identifier = var.identifier
  # log_client_ip - (optional) is a type of bool
  log_client_ip = var.log_client_ip
  # resource_group_name - (required) is a type of string
  resource_group_name = var.resource_group_name
  # sampling_percentage - (optional) is a type of number
  sampling_percentage = var.sampling_percentage
  # verbosity - (optional) is a type of string
  verbosity = var.verbosity

  dynamic "backend_request" {
    for_each = var.backend_request
    content {
      # body_bytes - (optional) is a type of number
      body_bytes = backend_request.value["body_bytes"]
      # headers_to_log - (optional) is a type of set of string
      headers_to_log = backend_request.value["headers_to_log"]
    }
  }

  dynamic "backend_response" {
    for_each = var.backend_response
    content {
      # body_bytes - (optional) is a type of number
      body_bytes = backend_response.value["body_bytes"]
      # headers_to_log - (optional) is a type of set of string
      headers_to_log = backend_response.value["headers_to_log"]
    }
  }

  dynamic "frontend_request" {
    for_each = var.frontend_request
    content {
      # body_bytes - (optional) is a type of number
      body_bytes = frontend_request.value["body_bytes"]
      # headers_to_log - (optional) is a type of set of string
      headers_to_log = frontend_request.value["headers_to_log"]
    }
  }

  dynamic "frontend_response" {
    for_each = var.frontend_response
    content {
      # body_bytes - (optional) is a type of number
      body_bytes = frontend_response.value["body_bytes"]
      # headers_to_log - (optional) is a type of set of string
      headers_to_log = frontend_response.value["headers_to_log"]
    }
  }

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
      # create - (optional) is a type of string
      create = timeouts.value["create"]
      # delete - (optional) is a type of string
      delete = timeouts.value["delete"]
      # read - (optional) is a type of string
      read = timeouts.value["read"]
      # update - (optional) is a type of string
      update = timeouts.value["update"]
    }
  }

}

top

Outputs

output "always_log_errors" {
  description = "returns a bool"
  value       = azurerm_api_management_diagnostic.this.always_log_errors
}

output "http_correlation_protocol" {
  description = "returns a string"
  value       = azurerm_api_management_diagnostic.this.http_correlation_protocol
}

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

output "log_client_ip" {
  description = "returns a bool"
  value       = azurerm_api_management_diagnostic.this.log_client_ip
}

output "sampling_percentage" {
  description = "returns a number"
  value       = azurerm_api_management_diagnostic.this.sampling_percentage
}

output "verbosity" {
  description = "returns a string"
  value       = azurerm_api_management_diagnostic.this.verbosity
}

output "this" {
  value = azurerm_api_management_diagnostic.this
}

top