Skip to content

Commit

Permalink
Merge pull request #1903 from darkowlzz/1327-handle-closed-spot-request
Browse files Browse the repository at this point in the history
Spot Instance Request: handle "closed" requests
  • Loading branch information
radeksimko authored Oct 15, 2017
2 parents 4fc6d6b + fd5f541 commit 3089ed0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions aws/resource_aws_spot_instance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{}

request := resp.SpotInstanceRequests[0]

// if the request is cancelled, then it is gone
if *request.State == "cancelled" {
// if the request is cancelled or closed, then it is gone
if *request.State == "cancelled" || *request.State == "closed" {
d.SetId("")
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion aws/resource_aws_spot_instance_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ func testAccCheckAWSSpotInstanceRequestDestroy(s *terraform.State) error {
return nil
}

if *s.State == "canceled" {
if *s.State == "canceled" || *s.State == "closed" {
// Requests stick around for a while, so we make sure it's cancelled
// or closed.
return nil
}

Expand Down

0 comments on commit 3089ed0

Please sign in to comment.