I want to be able to automatically trigger a deployment rollback if the deployment succeeds, but within a certain timeframe, some metric thresholds are triggered (memory %, CPU, bandwidth, etc).
This feels like quite a narrow and potentially complex use case. One case that springs to mind, is if the service had autoscaling enabled, increased resource use would scale more instances rather than rollback. In addition, a rollback wouldn’t revert any database migrations made in the latest deploy, so automatically rolling back could potentially leave the service in a broken state if migrations are part of your deploy process and don’t line up with the previous deploys code.
I’ve tried to think if there’s a way to recreate that behavior with the current feature set, but I don’t think there is, as rollbacks are not yet part of the API.
However, please feel free to add this as a feature request to our feedback site, so that it can be reviewed by our team and other customers.