provider/aws: Fix issue where spot instance requests would crash
Requests that are pending do not have an InstanceID
This commit is contained in:
parent
b4c1c223ff
commit
2fedaa9a4b
|
@ -166,7 +166,10 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Set("spot_bid_status", *request.Status.Code)
|
d.Set("spot_bid_status", *request.Status.Code)
|
||||||
|
// 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_instance_id", *request.InstanceID)
|
||||||
|
}
|
||||||
d.Set("spot_request_state", *request.State)
|
d.Set("spot_request_state", *request.State)
|
||||||
d.Set("tags", tagsToMap(request.Tags))
|
d.Set("tags", tagsToMap(request.Tags))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue