All Products
Search
Document Center

Elastic Compute Service:Release an instance

Last Updated:Jul 13, 2026

To avoid unnecessary charges for idle or unused ECS instances, you can release them immediately or at a scheduled time in the console or by calling an API. To prevent accidental release, you can enable release protection for the instance.

Impacts and risks

  • Data loss: When you release an instance, its local disk, system disk, and any data disk configured to be released with the instance are also released. In addition, automatic snapshots that are set to be released with their associated cloud disks are also deleted.

    Mitigation: Before you release an instance, back up its data by creating a snapshot or a custom image.

  • IP address loss: The static public IP address assigned to the instance is reclaimed and cannot be recovered.

    Mitigation: Convert the static public IP address to an EIP.

  • Ongoing charges: Resources not configured to be released with the instance, such as independent cloud disks, EIPs, and cloud disk snapshots, are retained and continue to incur charges.

    Mitigation: After you release the instance, check your billing details to identify and manually release any remaining billable resources.

Release a pay-as-you-go instance

Console

  1. Go to the ECS console - Instances page, and select the region and resource group where the target instance is located.

  2. In the Operation column for the target instance, click the Instance Status > Release.

  3. In the Release Instance dialog box, select a Release and click Next.

    • Release Now: This option releases the instance immediately.

    • Scheduled Release: This option automatically releases the instance at a specified time. How to cancel a scheduled release

  4. Carefully review the associated resources that will be released and retained. After you confirm the details, click OK. The system releases the instance based on the selected Release.

API

Release a subscription instance

Important

You can release only expired subscription instances. To release an unexpired subscription instance, you must first switch its billing method to pay-as-you-go.

Console

  1. Go to the ECS console - Instances page, and select the region and resource group where the target instance is located.

  2. In the Operation column for the target instance, click the Instance Status > Release.

  3. In the Release Instance dialog box, set Release to Release Now and click Next.

  4. Carefully review the associated resources that will be released and retained. After you confirm the details, click Confirmation.

API

When you release an expired subscription instance, you must set the TerminateSubscription parameter to true.

Instance release protection

When this feature is enabled, the system denies all manual release requests from the console, an API, or the CLI. This prevents the instance from being accidentally released due to human error or malicious activity.

This feature is available only for pay-as-you-go instances and applies only to manual release operations. It does not apply to the following system-triggered release scenarios:

  • Release of the instance due to an overdue payment.

  • A triggered scheduled release.

  • The instance is forcibly released for violating cloud platform security rules, for example, using an ECS instance to host an illegal website.

  • A scale-in event triggered by the instance's Auto Scaling group.

Enable release protection

Console

  1. Go to the ECS console - Instances page, and select the region and resource group where the target instance is located.

  2. In the Operation column for the target instance, click the Instance Settings > Enable Instance Release Protection.

  3. In the dialog box that appears, click OK.

API

To enable release protection, call the ModifyInstanceAttribute API and set the DeletionProtection parameter to true.

Expected result: An attempt to release the instance returns the InvalidOperation.DeletionProtection error code.

Disable release protection

Console

  1. Go to the ECS console - Instances page, and select the region and resource group where the target instance is located.

  2. In the Operation column for the target instance, click the Instance Settings > Disable Release Protection.

  3. In the dialog box that appears, click OK.

API

To disable release protection, call the ModifyInstanceAttribute API and set the DeletionProtection parameter to false.

Check release protection status

Console

  1. Go to the ECS console - Instances page, and select the region and resource group where the target instance is located.

  2. Click the instance ID to go to the instance details page. In the Other Information section, view the status of Release Protection.

API

Call DescribeInstances. If Instances.Instance.DeletionProtection is true, instance release protection is enabled.

Production best practices

In a production environment, follow these best practices to ensure resource security:

  • Enforce release protection: Enable release protection for all production instances to prevent critical assets from being accidentally deleted due to human error or malicious activity.

  • Access Control: Grant the permissions to release instances (ecs:DeleteInstance and ecs:DeleteInstances) only to authorized personnel. Also, separate the permission to modify instance attributes (disable release protection) (ecs:ModifyInstanceAttribute) from the permissions to release instances, and have them managed by different roles.

  • Auditing with ActionTrail: Enable ActionTrail to record all operations within your account. Configure alert rules for high-risk events such as DeleteInstance and ModifyInstanceAttribute. This allows you to receive immediate notifications for tracking, auditing, and rapid response.

FAQ

  • Why is the Release button disabled?

    The instance is most likely an unexpired subscription instance. Before you can release this type of instance, you must first from it or switch its billing method to pay-as-you-go.

  • Stopping vs. releasing an instance

    Stopping and releasing are different operations.

    • Stop: Similar to shutting down a computer. You can start the instance at any time to resume its operation.

    • Release: Similar to deleting or destroying a resource. This action permanently deletes the instance, its local disk, system disk, and any data disk configured to be released with it, and their data cannot be recovered. A released instance is removed from the instance list.

  • Can I recover a released instance?

    No. Releasing an instance is a permanent and irreversible action. The system does not retain any data or configuration from a released instance, so it cannot be recovered. As a best practice, always back up data before you release an instance.

  • Why are there charges after instance release?

    Releasing an instance does not release all its associated resources. Check your billing details to determine whether you are still being charged for associated resources such as independent cloud disks, EIPs, or snapshots.

  • How do I release instances in a batch?

  • How to cancel a scheduled release?

    On the ECS console - Instances page, click the instance ID to go to the instance details page. In the Basic Information > Auto Release Time and click Cancel.

    image