Merge pull request #4221 from hashicorp/b-aws-runinstances-check
provider/aws: Handle empty Instances response from RunInstances
This commit is contained in:
commit
9044807152
|
@ -370,6 +370,9 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
if err != nil {
|
||||
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]
|
||||
log.Printf("[INFO] Instance ID: %s", *instance.InstanceId)
|
||||
|
|
Loading…
Reference in New Issue