Commit 02e79b9e authored by Justin Santa Barbara's avatar Justin Santa Barbara

AWS: If we have no subnets, bail out early

We know the ELB call will fail, so we error out early rather than hitting the API. Preserves rate limit quota, and also allows us to give a more self-evident message. Fix #21993
parent 5cf83745
......@@ -2149,6 +2149,11 @@ func (s *AWSCloud) EnsureLoadBalancer(name, region string, publicIP net.IP, port
return nil, err
}
// Bail out early if there are no subnets
if len(subnetIDs) == 0 {
return nil, fmt.Errorf("could not find any suitable subnets for creating the ELB")
}
// Create a security group for the load balancer
var securityGroupID string
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment