Skip to content

Commit

Permalink
Handle nil IAP in backend service decoder (#3459)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and paddycarver committed Apr 26, 2019
1 parent 6e862e6 commit 0c43d8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google/resource_compute_backend_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0c43d8d

Please sign in to comment.