🛢️ Start Stop RDS Clusters - dvsa/des-workflow-actions GitHub Wiki

Description

This workflow manages the NonProd and PREP RDS clusters based on a specified action and environment.

Workflow Triggers

Manual Trigger

The workflow can be manually triggered by selecting an action and an environment from the GitHub Actions workflow dispatch UI.

Scheduled Trigger

The workflow also runs automatically on a schedule, at 5:45 AM and 6:45 PM, Monday to Friday as a cost saving measure. The scheduled workflow manages the dev and personal environment clusters. It also manages the UAT and PERF environments when these clusters are started using the manual trigger. It achieves this by obtaining and updating an exclusion list depending on which action is selected.

Inputs

Name Description Options
action The action to take on the RDS clusters start | stop
environment The RDS cluster environment to take the action on uat | perf | prep

Notes

Exclusions List

The workflow utilises an exclusion list, which is stored as a secret in AWS. This list determines which environments are included or excluded from scheduled runs based on their state.

For example, the UAT clusters will need to be started using the manual trigger prior to UAT taking place. This then removes the UAT environment from the exclusions list, meaning that it is now included in the scheduled runs to ensure that the clusters are stopped overnight and started in the morning. Once UAT is concluded, the cluster can be stopped using the manual trigger, which will then add the UAT environment to the exclusion list, meaning no start action will be taken on the environment on the scheduled runs. The stop action remains to ensure that the clusters are stopped after they're restarted by AWS after 7 days.

By dynamically updating the exclusion list, the workflow ensures that only necessary environments are running during scheduled times, reducing unnecessary costs.