mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-10 08:03:08 -06:00
provider/aws: nil protection against VPN connections [GH-2144]
This commit is contained in:
parent
e5a9cee5bb
commit
1cc5068b8c
@ -91,6 +91,12 @@ func resourceAwsVpnConnectionRouteRead(d *schema.ResourceData, meta interface{})
|
||||
return err
|
||||
}
|
||||
}
|
||||
if resp == nil || len(resp.VPNConnections) == 0 {
|
||||
// This is kind of a weird edge case. I'd rather return an error
|
||||
// instead of just blindly setting the ID to ""... since I don't know
|
||||
// what might cause this.
|
||||
return fmt.Errorf("No VPN connections returned")
|
||||
}
|
||||
|
||||
vpnConnection := resp.VPNConnections[0]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user