# Limit of Replicas policy

{% hint style="warning" %}
This documentation is **exclusive** to customers using the Consumption-Based Model and may not be applicable to your realm.
{% endhint %}

Excessive replica settings can lead to significant and unexpected financial costs. Additionally, unnecessary processing in test environments, like keeping an always-on pipeline active or running a large number of replicas without executions, can result in inefficient credit usage and increased costs, especially for consumption-based models.\
\
With the **Limit of Replicas policy**, you can limit:

* The minimum number of replicas for each environment.
* The maximum number of replicas for each environment.
* The target of replicas for each environment (when Autoscalling is off).

This will help you to prevent your consumption from misusage and control your credit consumption efficiently.

## How to define the replicas limit&#x20;

To define the number of replicas for each of your environments, follow the steps below:

1. Access the Digibee Integration Platform and click **Administration** at the top right corner.
2. Click **Policies** at the menu on the left side of the page.
3. Click **Deployments** on the top menu.&#x20;
4. At the **Limit of Replicas row,** click the **Edit icon**.
5. Set the number of replicas for each environment.
6. Click **Save** to implement the changes or **Cancel** to return to the previous screen.

Once your Limits of Replicas policy is configured, each new pipeline deployment operation must follow the rules according to your definitions.&#x20;

If a developer forgets to apply your policy, they will be reminded during the deployment phase. In other words, it isn't possible to deploy the pipeline, until the issues are resolved.&#x20;

## The impact of the Limit of Replicas policy on Platform usage

Users responsible for deployments will have their actions constrained by the number of replicas specified in the policy configuration. The following actions can only be performed within the defined limits:

* Create deploy
* Redeploy
* Promote to
* Restore
* Rollback&#x20;

Users responsible for deployments using [Digibeectl](https://docs.digibee.com/documentation/developer-guide/development-cycle/digibeectl) are also impacted by the policy. The following actions can only be performed in Digibeectl within the defined limits: &#x20;

* `--create deployment`
* `--create redeploy`
* `--set deployment rollback`

This ensures compliance with the policy while optimizing resource utilization.

## Permissions

Users with the **POLICY:UPDATE** permission can modify this policy, while users with the **POLICY:READ** permission can only view it.&#x20;

## Exceptions to the policy

The **POLICY:UPDATE** permission allows a user to specify a list of users and groups that are exceptions to the Limit of Replicas policy, allowing them to operate without the established replica limits.&#x20;

To create an exception list, access the **Limit of Replicas policy** on the Digibee Integration Platform and navigate to the **Policy exceptions by environment** section.&#x20;

### Exceptions for users

Type a name or email to add any users who should be considered exceptions within the Limit of Replicas policy.

### Exceptions for groups

Click + to add user groups that should be considered exceptions within the Limit of Replicas policy. You can [create a new group](https://docs.digibee.com/documentation/developer-guide/platform-administration/administration/new-access-control/access-control-groups) if you consider it necessary.
