To delete the ECS cluster and deregister the Task Definition:
Navigate to the Amazon ECS console and choose Clusters in the left menu.
Click the link of the cluster you created and choose Delete Cluster.
Choose Task Definitions in the left menu.
Click the link of the Task Definition you created.
Select all the Task Definition names.
In the Actions menu, select Deregister. Confirm by choosing Deregister in the confirmation modal.