All Products
Search
Document Center

Elastic Compute Service:Release an instance

Last Updated:May 15, 2026

Release idle ECS instances immediately or on a schedule via the console or API. Enable release protection to prevent accidental deletion.

Warning

Releasing an instance is permanent and irreversible. All data on its system disk, local disks, and any data disks configured for release with the instance is permanently lost.

Potential impacts

  • Data loss: The system disk, local disks, and data disks configured for release with the instance are permanently deleted. Automatic snapshots set for deletion with their associated cloud disks are also deleted.

    Mitigation: Create a snapshot or create a custom image before releasing.

  • IP address loss: The static public IP address is reclaimed and cannot be recovered.

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

  • Ongoing charges for associated resources: Cloud disks, EIPs, and snapshots not configured for release with the instance persist and continue to incur charges.

    Mitigation: Check your billing and manually release remaining billable resources.

Release a pay-as-you-go instance

Console

  1. Go to the ECS console - Instances page. Select the region and resource group.

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

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

  4. Confirm the associated resources to release and retain, then click OK.

API

Release a subscription instance

Important

Only expired subscription instances can be released. To release an unexpired subscription instance, first switch its billing method to pay-as-you-go.

Console

  1. Go to the ECS console - Instances page. Select the region and resource group.

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

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

  4. Confirm the associated resources to release and retain, then click Confirmation.

API

When releasing an expired subscription instance, specify TerminateSubscription=true.

Release protection

Release protection blocks all manual release requests from the console, API, and CLI to prevent accidental or unauthorized deletion.

This feature applies only to pay-as-you-go instances. It does not prevent automatic releases in the following scenarios:

  • Instance reclaimed due to an overdue payment.

  • Scheduled release task fires.

  • Instance forcibly released for violating platform security rules (for example, illegal content hosting).

  • Auto Scaling triggers a scale-in.

Enable release protection

Console

  1. Go to the ECS console - Instances page. Select the region and resource group.

  2. In the Operation column, click Instance Status > Enable Instance Release Protection.

  3. In the dialog box, click OK.

API

Call ModifyInstanceAttribute with DeletionProtection set to true.

After protection is enabled, release attempts return the InvalidOperation.DeletionProtection error code.

Disable release protection

Console

  1. Go to the ECS console - Instances page. Select the region and resource group.

  2. In the Operation column, click Instance Status > Disable Release Protection.

  3. In the dialog box, click OK.

API

Call ModifyInstanceAttribute with DeletionProtection set to false.

Check the release protection status

Console

  1. Go to the ECS console - Instances page. Select the region and resource group.

  2. Click the instance ID. In the Other Information section, check Release Protection.

API

Call DescribeInstances and check Instances.Instance.DeletionProtection. true means release protection is enabled.

Apply in production

Protect production instances from accidental release:

  • Enable release protection on all production instances. Prevents accidental deletion of critical resources.

  • Restrict release permissions. Grant ecs:DeleteInstance and ecs:DeleteInstances only to authorized roles. Assign ecs:ModifyInstanceAttribute (which controls release protection) to a separate role so that disabling protection and deleting instances require different people.

  • Enable ActionTrail for audit logging. ActionTrail logs all API operations in your account. Configure alerts for DeleteInstance and ModifyInstanceAttribute events to detect unauthorized actions immediately.

FAQ

  • Why is the Release button grayed out?

    The instance is most likely an unexpired subscription instance. Switch its billing method to pay-as-you-go first, then release.

  • What is the difference between stopping and releasing an instance?

    Stopping an instance shuts it down—you can restart it at any time. Releasing permanently deletes the instance, its system disk, local disks, and any data disks configured for release. This data cannot be recovered.

  • Can I recover an accidentally released instance?

    No. Releasing an instance is permanent and irreversible. Always back up data before releasing.

  • I released an instance, but I'm still being charged. Why?

    Releasing an instance does not release associated resources. Check your billing for independently billed resources such as cloud disks, EIPs, and snapshots, and release them manually.

  • How do I release multiple instances at once?

  • How do I cancel a scheduled release?

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

    image