All Products
Search
Document Center

Elastic Compute Service:Enable or disable release protection for ECS instances

Last Updated:Aug 06, 2025

For pay-as-you-go Elastic Compute Service (ECS) instances that host critical business applications or important data, we recommend that you enable release protection. This feature prevents an instance from being accidentally released, which can lead to data loss. After release protection is enabled for the instance, you cannot manually release the instance in the ECS console, by calling API operations, or by using the CLI. This topic describes how to configure release protection for ECS instances.

Prerequisites

The instance must be a pay-as-you-go instance.

Considerations

Release protection does not prevent automatic instance releases that are triggered for the following reasons:

  • A payment in your Alibaba Cloud account is overdue for more than 15 days.

  • The instance reaches its scheduled automatic release time.

  • The instance does not comply with applicable security compliance policies.

  • The instance was automatically created by Auto Scaling and is removed during subsequent scale-in events.

Impact of instance release protection

When you attempt to manually release instances in the ECS console, instances for which release protection is enabled are automatically skipped.

实例释放保护警告信息

Enable or disable release protection for instances

By default, release protection is disabled for instances. You can enable or disable release protection for instances when you create the instances or after the instances are created.

Scenario 1: Enable or disable release protection for existing instances

After you create pay-as-you-go instances, you can enable or disable release protection for the instances.

  1. Go to ECS console - Instance.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. 地域

  3. Find the instance that you want to manage, and click its ID to go to the Instance Details page. In the upper-right corner, click All Actions. In the panel that appears, find and click Enable Release Protection or Disable Release Protection. Then click OK.

Scenario 2: Enable or disable release protection when you create instances

When you create pay-as-you-go instances, release protection is disabled for the instances by default. You can manually enable release protection.

  1. Go to ECS console - Custom Launch.

  2. Set the Billing Method parameter to Pay-as-you-go and click Advanced Settings (Optional). For the Release Protection parameter, select Prevent Instances from Being Accidentally Released by Using the ECS Console or by Calling an API Operation.

    image

Check whether release protection is enabled for an instance

  1. Go to ECS console - Instance.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. 地域

  3. Click the ID of the instance that you want to manage to go to the instance details page. On the Instance Details tab, scroll down to the Other Information section and view the value of the Release Protection Enabled parameter.

    • Yes: Release protection is enabled for the instance.

    • No: Release protection is disabled for the instance.

    image

References

  • You can also call the following API operations to enable or disable release protection for instances:

    • ModifyInstanceAttribute: You can specify the DeletionProtection parameter to enable or disable release protection for existing instances.

    • RunInstances or CreateInstance: You can specify the DeletionProtection parameter to enable or disable release protection for instances that you want to create.

      Note

      If you call the DeleteInstance operation to release an instance for which release protection is enabled, the error code InvalidOperation.DeletionProtection is returned.

  • If you no longer need a protected instance, you must first disable release protection before you can release it. For information about how to release an instance, see Release an instance.

    Note

    You can specify an automatic release time for an instance after you disable release protection for the instance. The instance is automatically released at the specified time. For more information, see Release an instance or ModifyInstanceAutoReleaseTime.