Scheduling DB Instance Start/Stop Using Custom Tag
In this guide, you will automate the scheduling of AWS RDS DB Instances using Guardrails policies and a custom tag.
Turbot Guardrails' Instance Scheduling allows you to define pre-scheduled start and stop times for RDS DB Instances at the resource or account level. Automating scheduling ensures instances run only when needed, optimizing costs and improving efficiency.
Prerequisites
Turbot/Adminpermissions at the Turbot resource level.- The
aws-rdsmod installed in your Guardrails workspace. - At least one AWS RDS DB Instance discovered by Guardrails.
Step 1: Create the Schedule Tag Policy Setting
Navigate to Policies in the sidebar and click New Policy Setting in the top right to open the Create Policy Setting form.
For the Policy Type, search for RDS Schedule Tag and select Schedule Tag under AWS > RDS > DB Instance.

Step 2: Select the Target Resource
For the Resource, search for where the policy should apply. You can select a specific DB instance, an account, or a folder to apply the schedule broadly.

Step 3: Set the Value
Choose Enforce: Schedule per turbot_custom_schedule tag to enable tag-based scheduling. This tells Guardrails to read the schedule from a tag on each RDS instance. Click Create.

| Field | Value | Description |
|---|---|---|
| Setting | Enforce: Schedule per turbot_custom_schedule tag | Guardrails reads the schedule from the specified tag on each instance. |
| Precedence | Required (default) | Enforced on all descendants unless an exception is granted. |
[!NOTE] Guardrails also supports scheduling for RDS DB Clusters via the
AWS > RDS > DB Cluster > Schedule Tagpolicy.
Step 4: Create the Schedule Tag Name Policy Setting
Create a second policy setting for AWS > RDS > DB Instance > Schedule Tag > Name. This tells Guardrails which tag key to read the schedule from. Set the value to turbot_custom_schedule (or any tag key name you prefer) and apply it at the same resource level or higher in the hierarchy.

Step 5: Apply the Tag to the Instance
Apply a tag to the RDS DB Instance in the AWS Console (or via CLI or Terraform) with the exact key name you configured in Step 4 (for example, turbot_custom_schedule).
The tag value must be a Base64-encoded JSON cron expression defining start and stop times:
JSON format:
{"start": "* 8 * * MON-FRI", "stop": "* 16 * * MON-FRI"}
This schedule starts the instance at 8:00 AM and stops it at 4:00 PM, Monday through Friday (UTC).
Base64 encoded:
eyJzdGFydCI6ICIqIDggKiAqIE1PTi1GUkkiLCAic3RvcCI6ICIqIDE2ICogKiBNT04tRlJJIn0=
[!IMPORTANT] RDS tags require the value to be Base64-encoded because the JSON cron format contains characters that aren't valid in tag values.
Step 6: Review
- Verify that both policy settings (Schedule Tag and Schedule Tag Name) appear on the Policies page for the target resource.
- Check the Controls tab on the RDS instance for the Schedule Tag control. It should show OK if the tag is correctly applied and the schedule is valid.
- Monitor the RDS instance state in the AWS Console to confirm it stops and starts at the scheduled times.
- If the instance doesn't stop as expected, check the control logs for errors.
Troubleshooting
| Issue | Description | Guide |
|---|---|---|
| Schedule Tag control in Error | The tag value may not be valid Base64 or the decoded JSON may have an invalid cron expression. | Verify the Base64 encoding and ensure the JSON has valid start and stop cron fields. |
| Tag name doesn't match | The Schedule Tag Name policy value must exactly match the tag key on the instance. | Check both the policy value and the actual tag key on the instance in the AWS Console. |
| Schedule not triggering | Guardrails evaluates the schedule on each control run. The control may need time to run, or the instance may be in a state that prevents stop/start operations. | Check the control's Logs tab for details on the evaluation. |
| Further assistance | If the issue persists. | Open a Support Ticket |