provider/aws: Check for empty instances in AWS Instance RunInstance response
Fixes #4206
This commit is contained in:
parent
fcd8a881df
commit
9fc6c27de1
|
@ -370,6 +370,9 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error launching source instance: %s", err)
|
return fmt.Errorf("Error launching source instance: %s", err)
|
||||||
}
|
}
|
||||||
|
if runResp == nil || len(runResp.Instances) == 0 {
|
||||||
|
return fmt.Errorf("Error launching source instance: no instances returned in response")
|
||||||
|
}
|
||||||
|
|
||||||
instance := runResp.Instances[0]
|
instance := runResp.Instances[0]
|
||||||
log.Printf("[INFO] Instance ID: %s", *instance.InstanceId)
|
log.Printf("[INFO] Instance ID: %s", *instance.InstanceId)
|
||||||
|
|
Loading…
Reference in New Issue