Skip to content

Commit

Permalink
Merge pull request #2640 from hashicorp/b-aws-spot-instance-fix
Browse files Browse the repository at this point in the history
provider/aws: Fix issue where spot instance requests would crash
  • Loading branch information
catsby committed Jul 8, 2015
2 parents ec6f866 + 2fedaa9 commit d34bd0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/providers/aws/resource_aws_spot_instance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit d34bd0d

Please sign in to comment.