diff --git a/modules/azure/api_management_api_simple/main.tf b/modules/azure/api_management_api_simple/main.tf index 18e5720f..0de95bfd 100644 --- a/modules/azure/api_management_api_simple/main.tf +++ b/modules/azure/api_management_api_simple/main.tf @@ -71,7 +71,7 @@ resource "azurerm_api_management_api_diagnostic" "api_diagnostic" { http_correlation_protocol = var.api_diagnostic_settings.http_correlation_protocol frontend_request { - body_bytes = 32 + body_bytes = var.api_diagnostic_settings.bytes_to_log headers_to_log = [ "content-type", "accept", @@ -80,7 +80,7 @@ resource "azurerm_api_management_api_diagnostic" "api_diagnostic" { } frontend_response { - body_bytes = 32 + body_bytes = var.api_diagnostic_settings.bytes_to_log headers_to_log = [ "content-type", "content-length", @@ -89,7 +89,7 @@ resource "azurerm_api_management_api_diagnostic" "api_diagnostic" { } backend_request { - body_bytes = 32 + body_bytes = var.api_diagnostic_settings.bytes_to_log headers_to_log = [ "content-type", "accept", @@ -98,7 +98,7 @@ resource "azurerm_api_management_api_diagnostic" "api_diagnostic" { } backend_response { - body_bytes = 32 + body_bytes = var.api_diagnostic_settings.bytes_to_log headers_to_log = [ "content-type", "content-length", diff --git a/modules/azure/api_management_api_simple/variables.tf b/modules/azure/api_management_api_simple/variables.tf index 806435d0..3a1f9fd1 100644 --- a/modules/azure/api_management_api_simple/variables.tf +++ b/modules/azure/api_management_api_simple/variables.tf @@ -46,6 +46,7 @@ variable "api_management_logger_id" { variable "api_diagnostic_settings" { type = object({ sampling_percentage = number, + bytes_to_log = number, always_log_errors = bool, log_client_ip = bool, verbosity = string, # possible values: verbose, information, error @@ -56,6 +57,7 @@ variable "api_diagnostic_settings" { default = { sampling_percentage = 5.0, + bytes_to_log = 32 always_log_errors = true, log_client_ip = true, verbosity = "verbose", # possible values: verbose, information, error