Skip to content

Commit bfb2dea

Browse files
committed
Also handle TERMINATING state
1 parent e2dd6c0 commit bfb2dea

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

aws/resource_aws_emr_instance_group.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,15 @@ func resourceAwsEMRInstanceGroupRead(d *schema.ResourceData, meta interface{}) e
200200
return fmt.Errorf("error reading EMR Instance Group (%s): %s", d.Id(), err)
201201
}
202202

203-
if ig.Status != nil && aws.StringValue(ig.Status.State) == emr.InstanceGroupStateTerminated {
204-
log.Printf("[DEBUG] EMR Instance Group (%s) terminated, removing", d.Id())
205-
d.SetId("")
206-
return nil
203+
if ig.Status != nil {
204+
switch aws.StringValue(ig.Status.State) {
205+
case emr.InstanceGroupStateTerminating:
206+
fallthrough
207+
case emr.InstanceGroupStateTerminated:
208+
log.Printf("[DEBUG] EMR Instance Group (%s) terminated, removing", d.Id())
209+
d.SetId("")
210+
return nil
211+
}
207212
}
208213

209214
switch {

0 commit comments

Comments
 (0)