Skip to content

Commit cee85f6

Browse files
kameshrajq2w
authored andcommitted
fix(url_map): Adding create_before_destroy lifecycle.
The `target_http_proxy` resource depends on the `google_compute_url_map` resource, so Terraform attempts to update the `url_map` first when changes occur. If a custom `url_map` is added, the module tries to delete the default `url_map` before updating the one the `https_proxy` relies on, resulting in an error.
1 parent dd61bed commit cee85f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ resource "google_compute_url_map" "default" {
168168
count = var.create_url_map ? 1 : 0
169169
name = "${var.name}-url-map"
170170
default_service = google_compute_backend_service.default[keys(var.backends)[0]].self_link
171+
172+
lifecycle {
173+
create_before_destroy = true
174+
}
171175
}
172176

173177
resource "google_compute_url_map" "https_redirect" {

0 commit comments

Comments
 (0)