Handle nil IAP in backend service decoder (#3459)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-04-18 14:15:42 -07:00 committed by emily
parent 038c15561f
commit c4d8953838

View File

@ -1480,6 +1480,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")