EC2 and RDS Instance Scheduling with Tags

Automatically tag EC2 instances and RDS databases to enable automated start/stop scheduling for cost optimization.

Overview

EC2 instances and RDS databases can be automatically started and stopped based on tags to optimize costs by running resources only when needed. TagOps can automatically apply scheduling tags to your instances and databases, ensuring they are consistently included in automated scheduling workflows.

What TagOps Can Do

TagOps can automatically tag EC2 instances and RDS databases with the tags required for automated scheduling:

  • Automatic Tagging: TagOps rules automatically apply scheduling tags like Schedule: mon-fri-9-5, AutoStart: true, or Action: StartStop to EC2 instances and RDS databases when they are created or discovered
  • Conditional Tagging: Create rules to tag only specific resources (e.g., development instances, non-production environments, or resources matching name patterns)
  • Schedule-Based Tagging: Apply different schedule tags based on environment or workload type (e.g., Schedule: business-hours for production, Schedule: always-on for critical systems)
  • Consistent Coverage: Ensure all resources that should be scheduled have the required tags, preventing manual scheduling configuration
  • Environment-Based Tagging: Use different tag values for different environments to enable separate scheduling rules (e.g., development resources stop after hours, production resources run 24/7)
  • Service-Specific Tagging: Tag EC2 instances and RDS databases with appropriate scheduling tags based on your automation tool requirements

Example TagOps Rules

EC2 Instance Scheduling

Create a TagOps rule to automatically tag EC2 instances for scheduling:

  • Condition: Resource type is ec2:instance and tag Environment equals Development
  • Action: Add tag Schedule: mon-fri-9-5

TagOps will automatically apply these tags to instances, which can then be used by AWS EventBridge, Lambda functions, or other automation tools to start and stop instances based on the schedule.

RDS Database Scheduling

Create a TagOps rule to automatically tag RDS databases for scheduling:

  • Condition: Resource type is rds:db and tag Environment equals Development
  • Action: Add tag Action: StartStop

TagOps will automatically apply these tags to RDS databases, which can then be used by AWS Systems Manager Maintenance Windows with the AWS-StopRdsInstance and AWS-StartRdsInstance runbooks to start and stop databases based on the schedule.

Additional Resources