Cloud environments in AWS allow for multi-tenancy managed by the user himself, classic example are container orchestrators such as ECS or Kubernetes.
When you have two services, one needs memory another cpu and you put these in a single cluster. Then scaling-up is relatively trivial. Each time you need more capacity in terms of either cpu or memory, add more capacity. Since EC2 capacity means units in cpu and memory both.
Scaling up based on a single metric can very easily achieved using CloudWatch Alarms.
When scaling down, in order to reduce cost it requires to take into account both memory and cpu limits and not let any of the two drop below the required amount.
Since unfortunately CloudWatch Alarms do not allow to use boolean logic or take into account multiple metrics.
What is a good way to implement scale down of capacity for an auto scaling group?