mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-04 04:40:29 -06:00
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 {
|
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
Block a user