From 03ed8585ad806551a25848547e311c497f9a359b Mon Sep 17 00:00:00 2001 From: emily Date: Thu, 18 Apr 2019 18:07:37 +0000 Subject: [PATCH] Handle nil IAP in backend service decoder Signed-off-by: Modular Magician --- google-beta/resource_compute_backend_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google-beta/resource_compute_backend_service.go b/google-beta/resource_compute_backend_service.go index 27488b9ce0..d2623772df 100644 --- a/google-beta/resource_compute_backend_service.go +++ b/google-beta/resource_compute_backend_service.go @@ -1515,6 +1515,10 @@ func resourceComputeBackendServiceDecoder(d *schema.ResourceData, meta interface // We need to pretend IAP isn't there if it's disabled for Terraform to maintain // BC behaviour with the handwritten resource. v, ok := res["iap"] + if !ok || v == nil { + delete(res, "iap") + return res, nil + } m := v.(map[string]interface{}) if ok && m["enabled"] == false { delete(res, "iap")