From b1c97d3a82421deee38058c587da09508f5bae70 Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Thu, 18 Apr 2019 18:32:13 +0000 Subject: [PATCH] Handle null iap block in BackendService Signed-off-by: Modular Magician --- google-beta/resource_compute_backend_service.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/google-beta/resource_compute_backend_service.go b/google-beta/resource_compute_backend_service.go index 27488b9ce0..42c741efdb 100644 --- a/google-beta/resource_compute_backend_service.go +++ b/google-beta/resource_compute_backend_service.go @@ -1515,9 +1515,12 @@ 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"] - m := v.(map[string]interface{}) - if ok && m["enabled"] == false { - delete(res, "iap") + if ok { + m := v.(map[string]interface{}) + + if m["enabled"] == false { + delete(res, "iap") + } } return res, nil