If you use a pay-as-you-go ECS instance to deploy critical business or store important data or configurations, we recommend that you enable release protection for the instance to prevent accidental release, which may cause irreparable consequences. After release protection is enabled, 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 uses the pay-as-you-go billing method.
Considerations
The release protection feature cannot prevent the automatic release of instances that is triggered by normal reasons, such as the following ones:
A payment in your Alibaba Cloud account is overdue for more than 15 days.
The automatic release time that you set for the instance arrives.
The instance does not comply with the applicable security compliance policies.
The instance was automatically created by Auto Scaling and is removed during subsequent scale-in events.
Effects of instance release protection
When you attempt to manually release instances in the ECS console, instances with release protection 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 them or after they are created.
Scenario 1: Enable or disable release protection for existing instances
After pay-as-you-go instances are created, you can enable or disable release protection for them.
Go to ECS console - Instance.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Click the ID of the target instance to go to the instance details page. Click All Operations to expand all operation panels, and then search for and click Enable Release Protection or Disable Release Protection. In the Enable Release Protection or Disable Release Protection dialog box, click Enable Protection or Disable Protection.
Scenario 2: Enable or disable release protection when you create an instance
When you create a pay-as-you-go instance, release protection is disabled by default. If you need to enable it, you must manually perform the operation.
When you create a Pay-As-You-Go instance, click Advanced (Optional). In the Instance Release Protection section, select Prevent Accidental Release From The Console Or API.
Check whether release protection is enabled for an instance
Go to ECS console - Instance.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Click the ID of the target instance to go to the instance details page. In the Other Information section, check the Release Protection field.
Yes: Release protection is enabled for the instance.
No: Release protection is disabled for the instance.
References
You can also call the following API operations to enable or disable release protection for instances:
Enable or disable release protection for existing instances: Call the API ModifyInstanceAttribute and set the
DeletionProtection
parameter to enable or disable release protection for existing instances.Enable or disable release protection when you create an instance: Call the API RunInstances or CreateInstance and set the
DeletionProtection
parameter to enable or disable release protection when you create an instance.NoteIf you call the API DeleteInstance to release an instance for which release protection is enabled, the error code
InvalidOperation.DeletionProtection
is returned.
If you no longer need an instance for which release protection is enabled, you can disable release protection for the instance and then release it. For more information about how to release an instance, see Release an instance.
NoteYou can specify an automatic release time for an instance after you disable release protection for it. The instance is automatically released at the specified time. For more information, see Release an instance or ModifyInstanceAutoReleaseTime - Modify the automatic release time of an instance.