Merge pull request #2640 from hashicorp/b-aws-spot-instance-fix

provider/aws: Fix issue where spot instance requests would crash
This commit is contained in:
Clint 2015-07-08 12:32:13 -06:00
commit d34bd0d227
1 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,10 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{}
}
d.Set("spot_bid_status", *request.Status.Code)
d.Set("spot_instance_id", *request.InstanceID)
// Instance ID is not set if the request is still pending
if request.InstanceID != nil {
d.Set("spot_instance_id", *request.InstanceID)
}
d.Set("spot_request_state", *request.State)
d.Set("tags", tagsToMap(request.Tags))