If your ECS instances provide critical services, you can enable release protection for these ECS instances to prevent irreversible data loss resulting from accidental or incorrect operations during a manual release. This topic describes how to enable and disable instance release protection and view the instance release protection status.
- Instance release protection applies only to Pay-As-You-Go instances.
- An automatic release of an instance due to normal circumstances take precedence. These
circumstances include, but are not limited to:
- A payment under your account is overdue for more than 15 days.
- The automatic release time that you set for the instance is reached.
- The instance does not comply with the applicable security compliance policies.
- The instance was automatically created by Auto Scaling and consequently is removed from the scaling group when the scaling group scales in.
Enable instance release protection when you create an instance
To enable instance release protection when you create an instance, follow these steps:
- On the Instances page, click Create Instance.
- On the Basic Configurations page, set the Billing Method to Pay-As-You-Go, set other parameters as needed, and then click Next: Networking.
- On the Networking page, set the parameters as needed, and then click Next: System Configurations.
- On the System Configurations page, select Prevent users from releasing the instance inadvertently by using the console or API, set the parameters as needed, and then click Next: Grouping.
- On the Grouping page, set the parameters as needed, and then click Next: Preview and confirm your settings.
Enable or disable instance release protection by modifying instance information
To enable or disable instance release protection by modifying the information of an instance, follow these steps:
- On the Instances page, choose in the Actions column of the instance to be modified.
- In the Modify Instance Attributes dialog box, select Enable Instance Release Protection.
Note To disable the instance release protection, clear Enable Instance Release Protection.
- Click OK.
When you modify instance information through ModifyInstanceAttribute, you can use the DeletionProtection parameter to enable or disable instance release protection.
View the instance release protection status
To view the release protection status of an instance, follow these steps:
- On the Instances page, click the target instance in the Instance ID/Name column, or click Manage in the Actions column of the instance.
- On the Instance Details page, view the status of Enable release protection in the Payment Information area.
Example of protection effect
After you enable release protection for an instance, a warning message will be displayed if you try to manually release the instance. If you want to manually release the instance, you must disable instance release protection.
After you enable release protection for an instance, the error code
InvalidOperation.DeletionProtection is returned if you try to use DeleteInstanceto delete the instance.