Stop/start/Destruction of resources
Once the practice "1O3 - Destruction of unused resources" has been implemented, it must be made continuous. We therefore let the tool(s) of our choice run continuously to hunt down unnecessary resources and put in place a process of analysis, validation and change planning.
To detect the instances to be deleted, we will rely on the use of resources of course, but also on the tagging policy and the ability to recreate the instances on demand.
But it is not only a question of destroying useless resources, it is also necessary to be able to set up a global scheduling for the stop/start of the instances according to the needs of availability.
Example of stop/start automation on AWS
- Configure CloudWatch to trigger an alarm at certain times of the day and/or when resources are idle for a period of time
- Trigger a Lambda function that will launch a Python script to stop the concerned instances by making an API call.
Of course the CMPs on the market also offer the automation of such events. Other available tools allowing this type of action :