mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-05 17:52:38 +00:00
fix panic when setting empty iap block (#1232)
This commit is contained in:
parent
7c12f534be
commit
ddfb7ef2cf
|
@ -344,15 +344,19 @@ func resourceComputeBackendServiceDelete(d *schema.ResourceData, meta interface{
|
|||
}
|
||||
|
||||
func expandIap(configured []interface{}) *compute.BackendServiceIAP {
|
||||
data := configured[0].(map[string]interface{})
|
||||
iap := &compute.BackendServiceIAP{
|
||||
if len(configured) == 0 {
|
||||
return nil
|
||||
}
|
||||
if data, ok := configured[0].(map[string]interface{}); ok {
|
||||
return &compute.BackendServiceIAP{
|
||||
Enabled: true,
|
||||
Oauth2ClientId: data["oauth2_client_id"].(string),
|
||||
Oauth2ClientSecret: data["oauth2_client_secret"].(string),
|
||||
ForceSendFields: []string{"Enabled", "Oauth2ClientId", "Oauth2ClientSecret"},
|
||||
}
|
||||
}
|
||||
|
||||
return iap
|
||||
return nil
|
||||
}
|
||||
|
||||
func flattenIap(iap *compute.BackendServiceIAP) []map[string]interface{} {
|
||||
|
|
Loading…
Reference in New Issue
Block a user