# Scheduled Scaling (AWS)

## Overview

Scheduled Scaling is an Autofix module feature that allows for the automatic adjustment of cloud resource capacity based on predefined schedules. It enables infrastructure to scale up or down at strategic times, ensuring the ideal balance between operational performance and cost efficiency.

## Business Objective

The focus of this feature is to align infrastructure supply with actual and predictable business demand. Scheduled Scaling resolves overprovisioning issues in scenarios such as:

* **Predictable Peaks:** Applications that receive load only during business hours.
* **Specific Seasonality:** Increased demand during marketing campaigns or closing periods.
* **Limited Environments:** Testing or staging resources that only need to be active during working hours.
* **Idleness Reduction:** Drastic capacity reduction on weekends and holidays.

***

## Supported Resources

Scheduled Scaling primarily acts on scaling groups, allowing for fine-tuning of:

* **Auto Scaling Groups (ASG):** Dynamic modification of capacity parameters.
* **Editable Parameters:** Desired Capacity, Minimum Capacity (Min), and Maximum Capacity (Max).

***

## How It Works: The Configuration Flow

The operation is divided into three fundamental stages to ensure precision and control:

#### 1. Scope Definition

The first step is to identify which resources will be impacted by the rule:

* **Selection:** Definition of the AWS account and region.
* **Identification:** Resources can be filtered by Tag, Resource Name, or Resource ID.
* **Filter Logic:** Use of expressions such as CONTAINS or NOT CONTAINS for precise inclusion or exclusion of resources in the scaling group.

#### 2. Capacity Definition

In this stage, the new resource limits for the scheduled period are determined:

* **Desired Capacity:** The number of instances the system will attempt to maintain.
* **Minimum/Maximum Capacity:** Defines the safety "boundary" for automatic scaling.

#### 3. Scheduling

Configuration of the execution calendar:

* **Periodicity:** Definition of the days of the week.
* **Precision:** Exact start and end times for the action.
* **Automation:** Once configured, the system takes over the recurring cycle without human intervention.

***

## FinOps Impact

The strategic application of Scheduled Scaling reflects in financial and technical health indicators:

* **Structural Optimization:** Alignment of the cost base with the actual demand curve.
* **Overprovisioning Reduction:** Elimination of costs for instances that would remain powered on unnecessarily.
* **Financial Predictability:** Facilitates monthly spending estimates based on standardized usage behavior.

***

## Best Practices

* **Application Validation:** Ensure the application supports instance reduction and can perform the necessary warm-up when restarting.
* **Tag Control:** Use specific tags (e.g., `AutoScalingGroup: Scheduled`) to ensure more granular control and avoid affecting critical resources.
* **Non-critical Environments:** Start implementation in Sandbox or QA environments to validate peak times before applying to Production.
* **Periodic Review:** Adjust schedules according to business growth or changes in user behavior.

***

## For use and access in the Pier platform:

The Scheduled Scaling feature allows to configure automation for some AWS services and resources. Through this configuration, depending on your environment, it is possible to reduce scaling on weekends, or increase scaling during peak hours, by configuring it here.

1. **Accessing Scheduled Scaling**.&#x20;

In the Autofix side menu, select Scheduled Scaling.

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FpK9dSxoqlPoc3jK3qznf%2Fimage.png?alt=media&#x26;token=0d566455-4587-40f8-8bb1-9df18dc09a57" alt=""><figcaption></figcaption></figure>

This functionality supports the following services: **Auto Scaling Groups, ElastiCache, OpenSearch and RDS IOPS.**

<figure><img src="https://1687673077-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9sinLUl52lDK1vg6b8g%2Fuploads%2FFQl6B79NqDbODto9kTGV%2Fimage.png?alt=media&#x26;token=db0cddbc-fd0c-41af-ab21-39c157d49ed5" alt=""><figcaption></figcaption></figure>
