Skip to content

Commit

Permalink
r/aws_appstream_fleet: handle ResourceNotFound during stop fleet
Browse files Browse the repository at this point in the history
During destroy the StopFleet operation was not handling ResourceNotFound exceptions. This change will capture these errors and proceed with removing the resource from state as nothing further is required to delete the resource.
  • Loading branch information
jar-b committed Apr 2, 2024
1 parent 674173b commit ff09dc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/service/appstream/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ func resourceFleetDelete(ctx context.Context, d *schema.ResourceData, meta inter
_, err := conn.StopFleetWithContext(ctx, &appstream.StopFleetInput{
Name: aws.String(d.Id()),
})
if tfawserr.ErrCodeEquals(err, appstream.ErrCodeResourceNotFoundException) {
return diags
}
if err != nil {
return sdkdiag.AppendErrorf(diags, "stopping Appstream Fleet (%s): %s", d.Id(), err)
}
Expand Down

0 comments on commit ff09dc6

Please sign in to comment.