Skip to content

Commit

Permalink
Merge pull request #1892 from terraform-providers/b-batch-deletion-state
Browse files Browse the repository at this point in the history
r/batch_job_queue: Wait for update completion when disabling
  • Loading branch information
radeksimko authored Oct 16, 2017
2 parents 029107d + 28c9fc8 commit fb52fc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aws/resource_aws_batch_job_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ func resourceAwsBatchJobQueueDelete(d *schema.ResourceData, meta interface{}) er

// Wait until the Job Queue is disabled before deleting
stateConf := &resource.StateChangeConf{
Pending: []string{batch.JQStateEnabled},
Target: []string{batch.JQStateDisabled},
Refresh: batchJobQueueRefreshStateFunc(conn, sn),
Pending: []string{batch.JQStatusUpdating},
Target: []string{batch.JQStatusValid},
Refresh: batchJobQueueRefreshStatusFunc(conn, sn),
Timeout: 10 * time.Minute,
Delay: 10 * time.Second,
MinTimeout: 3 * time.Second,
Expand All @@ -154,6 +154,7 @@ func resourceAwsBatchJobQueueDelete(d *schema.ResourceData, meta interface{}) er
if err != nil {
return err
}

log.Printf("[DEBUG] Trying to delete Job Queue %s", sn)
_, err = conn.DeleteJobQueue(&batch.DeleteJobQueueInput{
JobQueue: aws.String(sn),
Expand Down

0 comments on commit fb52fc7

Please sign in to comment.