Intensely utilized ECS Clusters can cost lots of Benjamins. Needless to say, there is no way around to lower the costs in Production environments besides provisioning appropriate type of instances for the tasks, coding efficiently, architecting a well-planned infrastructure and so on since the clusters must be running all the times. But of course an Infrastructure Engineer can take actions on Development environments to lower the costs.
I’m shutting down all clusterson Development environment between 23:00-07:00 in my way by a Python Lambda script which gets deployed by Terraform. I stop clusters by setting their AutoScalingGroup to 0. This makes all ContainerInstances to shutdown. But what about the inital ASG states? Where do minimum, maximum and desired values go? I write them to a DynamoDBTable before setting them to 0.
I start the clusters by reading and setting the initial values for Cluster specific ASG from that DynamoDB Table.
For the schedule, I’m using CW Event Rules to trigger the Lambda script.
I am a person who believes that if someone wants to do a successful job, they first need to understand what the job is fundamentally. I love how Albert Einstein put it as he states:
If you can’t explain it simply, you don’t understand it well enough.
– Albert Einstein
With that being said, I consider Amazon’s DevOps definition as a simple yet amazing definition. It describes DevOps in a rough way but also covers nearly everything. Although, it needs some elaboration.
From what I’ve seen, ~99% of the definitions on the internet don’t cover up everything related to DevOps. Let’s be ~1%.
If you know what DevOps actually is, you will start seeing things from a different, constructive, rewarding and top-view perspective and contribute even more to your team.