Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled extenstion of logging for APIM AB#20739 #416

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/azure/api_management/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,22 @@ resource "azurerm_api_management_diagnostic" "apim_diagnostic" {
http_correlation_protocol = var.diagnostic_settings.http_correlation_protocol

frontend_request {
body_bytes = 32
body_bytes = var.diagnostic_settings.frontend_request_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_request
}

frontend_response {
body_bytes = 32
body_bytes = var.diagnostic_settings.frontend_response_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_response
}

backend_request {
body_bytes = 32
body_bytes = var.diagnostic_settings.backend_request_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_request
}

backend_response {
body_bytes = 32
body_bytes = var.diagnostic_settings.backend_response_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_response
}
}
Expand Down
36 changes: 22 additions & 14 deletions modules/azure/api_management/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,31 @@ variable "api_management_logger_settings" {

variable "diagnostic_settings" {
type = object({
sampling_percentage = number,
always_log_errors = bool,
log_client_ip = bool,
verbosity = string, # possible values: verbose, information, error
http_correlation_protocol = string, # possible values: None, Legacy, W3C
headers_to_log_request = list(string),
headers_to_log_response = list(string)
sampling_percentage = number,
always_log_errors = bool,
log_client_ip = bool,
verbosity = string, # possible values: verbose, information, error
http_correlation_protocol = string, # possible values: None, Legacy, W3C
headers_to_log_request = list(string),
headers_to_log_response = list(string),
frontend_request_body_bytes = number,
frontend_response_body_bytes = number,
backend_request_body_bytes = number,
backend_response_body_bytes = number
})
description = "Settings for api management diagnostic, api-management-diagnostic will be created only if api_management_logger_settings have been provided. "
default = {
sampling_percentage = 5.0,
always_log_errors = true,
log_client_ip = true,
verbosity = "verbose", # possible values: verbose, information, error
http_correlation_protocol = "W3C",
headers_to_log_request = ["content-type", "accept", "origin"],
headers_to_log_response = ["content-type", "content-length", "origin"]
sampling_percentage = 5.0,
always_log_errors = true,
log_client_ip = true,
verbosity = "verbose", # possible values: verbose, information, error
http_correlation_protocol = "W3C",
headers_to_log_request = ["content-type", "accept", "origin"],
headers_to_log_response = ["content-type", "content-length", "origin"],
frontend_request_body_bytes = 32,
frontend_response_body_bytes = 32,
backend_request_body_bytes = 32,
backend_response_body_bytes = 32
}
}

Expand Down