Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore additional error when deleting fleet #32866

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/32866.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_emr_instance_fleet: Fix fleet deletion failing for terminated clusters
```
4 changes: 4 additions & 0 deletions internal/service/emr/instance_fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,13 @@ func resourceInstanceFleetDelete(ctx context.Context, d *schema.ResourceData, me
},
})

// Ignore certain errors that indicate the fleet is already (being) deleted
if tfawserr.ErrMessageContains(err, emr.ErrCodeInvalidRequestException, "instance fleet may only be modified when the cluster is running or waiting") {
return diags
}
if tfawserr.ErrMessageContains(err, emr.ErrCodeInvalidRequestException, "A job flow that is shutting down, terminated, or finished may not be modified") {
return diags
}

if err != nil {
return sdkdiag.AppendErrorf(diags, "deleting EMR Instance Fleet (%s): %s", d.Id(), err)
Expand Down
Loading