diff --git a/modules/net-lb-app-ext/README.md b/modules/net-lb-app-ext/README.md
index fa8a7a3c2..6a6b0c95c 100644
--- a/modules/net-lb-app-ext/README.md
+++ b/modules/net-lb-app-ext/README.md
@@ -1076,7 +1076,7 @@ After provisioning this change, and verifying that the new certificate is provis
| [neg_configs](variables.tf#L128) | Optional network endpoint groups to create. Can be referenced in backends via key or outputs. | map(object({…})) | | {} |
| [protocol](variables.tf#L243) | Protocol supported by this load balancer. | string | | "HTTP" |
| [ssl_certificates](variables.tf#L256) | SSL target proxy certificates (only if protocol is HTTPS) for existing, custom, and managed certificates. | object({…}) | | {} |
-| [urlmap_config](variables-urlmap.tf#L19) | The URL map configuration. | object({…}) | | {…} |
+| [urlmap_config](variables-urlmap.tf#L19) | The URL map configuration. | object({…}) | | {…} |
| [use_classic_version](variables.tf#L274) | Use classic Global Load Balancer. | bool | | true |
## Outputs
diff --git a/modules/net-lb-app-ext/urlmap.tf b/modules/net-lb-app-ext/urlmap.tf
index 6017c2f9c..9058c844c 100644
--- a/modules/net-lb-app-ext/urlmap.tf
+++ b/modules/net-lb-app-ext/urlmap.tf
@@ -729,6 +729,30 @@ resource "google_compute_url_map" "default" {
route_rules.value.service,
route_rules.value.service
)
+ dynamic "custom_error_response_policy" {
+ for_each = (
+ route_rules.value.custom_error_response_policy == null
+ ? []
+ : [route_rules.value.custom_error_response_policy]
+ )
+ iterator = p
+ content {
+ error_service = p.value.error_service == null ? null : lookup(
+ local.backend_ids,
+ p.value.error_service,
+ p.value.error_service
+ )
+ dynamic "error_response_rule" {
+ for_each = coalesce(p.value.error_response_rules, [])
+ iterator = r
+ content {
+ match_response_codes = r.value.match_response_codes
+ path = r.value.path
+ override_response_code = r.value.override_response_code
+ }
+ }
+ }
+ }
dynamic "header_action" {
for_each = (
route_rules.value.header_action == null
diff --git a/modules/net-lb-app-ext/variables-urlmap.tf b/modules/net-lb-app-ext/variables-urlmap.tf
index 85d4fe718..04f184b1b 100644
--- a/modules/net-lb-app-ext/variables-urlmap.tf
+++ b/modules/net-lb-app-ext/variables-urlmap.tf
@@ -280,6 +280,14 @@ variable "urlmap_config" {
route_rules = optional(list(object({
priority = number
service = optional(string)
+ custom_error_response_policy = optional(object({
+ error_service = optional(string)
+ error_response_rules = optional(list(object({
+ match_response_codes = optional(list(string))
+ path = optional(string)
+ override_response_code = optional(number)
+ })))
+ }))
header_action = optional(object({
request_add = optional(map(object({
value = string