0 00:00:00.000 --> 00:00:03.120 So let's make sure to destroy everything before we're done 1 00:00:03.120 --> 00:00:05.920 So first, we need to stop the service 2 00:00:05.920 --> 00:00:08.560 So to stop the service, make sure you have zero tasks running 3 00:00:08.560 --> 00:00:12.400 If not, you update the service and you set the desired task to zero 4 00:00:12.400 --> 00:00:16.000 And then you can click on delete service, type in delete, 5 00:00:16.000 --> 00:00:18.000 and this will delete the service 6 00:00:18.000 --> 00:00:20.879 Now, when you delete the service, this is actually going to go into 7 00:00:21.520 --> 00:00:22.959 a service called CloudFormation 8 00:00:23.680 --> 00:00:29.680 And CloudFormation is going to take its time to delete the entire stack that it created 9 00:00:29.920 --> 00:00:32.560 So part of the things it's going to delete is the ECS service, 10 00:00:32.560 --> 00:00:35.680 but also your load balancer listener, your load balancer itself, 11 00:00:35.680 --> 00:00:38.160 the security group, and the target groups 12 00:00:38.160 --> 00:00:39.919 So this can take a little bit of time, 13 00:00:39.919 --> 00:00:41.919 and we need to wait for everything to be deleted 14 00:00:42.639 --> 00:00:44.480 And when the service is fully deleted, 15 00:00:44.480 --> 00:00:46.799 then you can go and delete this cluster 16 00:00:46.799 --> 00:00:48.880 So for this, you just click on delete cluster, 17 00:00:48.880 --> 00:00:52.320 and it's going to delete the demo cluster 18 00:00:53.200 --> 00:00:54.480 And we can do this right now 19 00:00:55.119 --> 00:00:57.919 And again, this is going to start something in CloudFormation 20 00:00:58.000 --> 00:01:01.759 to delete the infrastructure of the ECS cluster 21 00:01:01.759 --> 00:01:03.520 So that includes the capacity provider, 22 00:01:03.520 --> 00:01:05.680 the autoscaling group that we have created, 23 00:01:05.680 --> 00:01:07.919 the cluster, and the launch template 24 00:01:07.919 --> 00:01:08.800 So this is very good 25 00:01:09.440 --> 00:01:12.559 Finally, for your task definition, you can leave them as is 26 00:01:12.559 --> 00:01:13.760 They don't cost you any money 27 00:01:13.760 --> 00:01:14.720 They're just definitions 28 00:01:15.360 --> 00:01:18.400 But if you wanted to, you could also click on one of them 29 00:01:18.400 --> 00:01:22.639 and deregister, do action and deregister the task definition itself 30 00:01:22.639 --> 00:01:23.440 So that's it 31 00:01:23.440 --> 00:01:24.639 I hope you liked it 32 00:01:24.639 --> 00:01:26.400 And I will see you in the next lecture