Skip to content

Commit

Permalink
Add policy for apim (#2292)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblackmoor authored Sep 30, 2024
1 parent 64b8ed5 commit cab4130
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 59 deletions.
96 changes: 48 additions & 48 deletions infrastructure/api-mgmt-logging.tf
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
# resource "azurerm_api_management_api_diagnostic" "apim_logs" {
# provider = azurerm.aks-cftapps
# identifier = "applicationinsights"
# resource_group_name = local.api_mgmt_rg
# api_management_name = local.api_mgmt_name
# api_name = "bulk-scan-api"
# api_management_logger_id = "/subscriptions/${var.cft_subscription_id}/resourceGroups/${local.api_mgmt_rg}/providers/Microsoft.ApiManagement/service/${local.api_mgmt_name}/loggers/cft-api-mgmt-${local.api_mgmt_suffix}-logger"
resource "azurerm_api_management_api_diagnostic" "apim_logs" {
provider = azurerm.aks-cftapps
identifier = "applicationinsights"
resource_group_name = local.api_mgmt_rg
api_management_name = local.api_mgmt_name
api_name = "bulk-scan-api"
api_management_logger_id = "/subscriptions/${var.cft_subscription_id}/resourceGroups/${local.api_mgmt_rg}/providers/Microsoft.ApiManagement/service/${local.api_mgmt_name}/loggers/cft-api-mgmt-${local.api_mgmt_suffix}-logger"

# sampling_percentage = 100.0
# always_log_errors = true
# log_client_ip = true
# verbosity = "verbose"
# http_correlation_protocol = "W3C"
sampling_percentage = 100.0
always_log_errors = true
log_client_ip = true
verbosity = "verbose"
http_correlation_protocol = "W3C"

# frontend_request {
# body_bytes = 8192
# headers_to_log = [
# "content-type",
# "accept",
# "origin",
# ]
# }
frontend_request {
body_bytes = 8192
headers_to_log = [
"content-type",
"accept",
"origin",
]
}

# frontend_response {
# body_bytes = 8192
# headers_to_log = [
# "content-type",
# "content-length",
# "origin",
# ]
# }
frontend_response {
body_bytes = 8192
headers_to_log = [
"content-type",
"content-length",
"origin",
]
}

# backend_request {
# body_bytes = 8192
# headers_to_log = [
# "content-type",
# "accept",
# "origin",
# ]
# }
backend_request {
body_bytes = 8192
headers_to_log = [
"content-type",
"accept",
"origin",
]
}

# backend_response {
# body_bytes = 8192
# headers_to_log = [
# "content-type",
# "content-length",
# "origin",
# ]
# }
backend_response {
body_bytes = 8192
headers_to_log = [
"content-type",
"content-length",
"origin",
]
}

# depends_on = [
# module.api_mgmt
# ]
# }
depends_on = [
module.api_mgmt
]
}
22 changes: 11 additions & 11 deletions infrastructure/api-mgmt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ module "api_mgmt" {
}
}

# module "api_mgmt_policy" {
# source = "[email protected]:hmcts/cnp-module-api-mgmt-api-policy?ref=master"
# api_mgmt_name = local.api_mgmt_name
# api_mgmt_rg = local.api_mgmt_rg
# api_name = module.api_mgmt.name
# api_policy_xml_content = data.template_file.apim_policy.rendered

# providers = {
# azurerm = azurerm.aks-cftapps
# }
# }
module "api_mgmt_policy" {
source = "[email protected]:hmcts/cnp-module-api-mgmt-api-policy?ref=master"
api_mgmt_name = local.api_mgmt_name
api_mgmt_rg = local.api_mgmt_rg
api_name = module.api_mgmt.name
api_policy_xml_content = data.template_file.apim_policy.rendered

providers = {
azurerm = azurerm.aks-cftapps
}
}

0 comments on commit cab4130

Please sign in to comment.