You can enable release protection for ECS instances to prevent manual release and avoid potential irreparable consequences arising from accidental instance release. This topic describes how to enable and disable release protection for ECS instances, how to check whether release protection is enabled, and how release protection is implemented.

Prerequisites

The release protection feature is only applicable to pay-as-you-go instances.

Background information

The release protection feature cannot prevent the automatic release of instances. For example, an instance will be automatically released in the following circumstances:
  • A payment in your account is overdue for longer than 15 days.
  • The automatic release time that you set for the instance has been reached.
  • The instance does not comply with the applicable security compliance policies.
  • The instance was automatically created by Auto Scaling and is removed by subsequent scale-in events.
The following examples show how release protection takes effect:
  • After you enable release protection for an instance, you cannot manually release the instance. An alert message as shown in the following figure is displayed if you attempt to do so. To manually release the instance, you must disable release protection. For more information about how to disable release protection, see the Enable or disable release protection by modifying instance attributes section in this topic.Release protection alert
  • After you enable release protection for an instance, you will receive the InvalidOperation.DeletionProtection error code if you attempt to call the DeleteInstance operation to release the instance.

Enable release protection when you create an instance

Note This section describes how to configure release protection settings when you create an instance. For information about other settings required when you create an instance, see Create an instance by using the provided Wizard.
  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. On the Instances page, click Create Instance.
  5. In the Basic Configurations step, set Billing Method to Pay-As-You-Go and complete the remaining configurations as needed. Click Next: Networking.
  6. In the Networking step, complete all configurations as needed. Click Next: System Configurations.
  7. In the System Configurations step, select Prevent users from releasing the instance inadvertently by using the console or API and complete the remaining configurations as needed. Click Next: Grouping.
    Enable release protection when you create an instance
  8. Complete the remaining configurations as needed until the instance is created.

When you call the RunInstances or CreateInstance operation to create an instance, you can enable or disable release protection for the instance by setting the DeletionProtection parameter.

Enable or disable release protection by modifying instance attributes

You can also enable or disable release protection for an instance by modifying the attributes of the instance. Follow these steps:

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. On the Instances page, find the instance for which you want to modify the release protection setting. Choose More > Instance Settings > Change Release Protection Setting in the Actions column.
  5. In the Change Release Protection Setting dialog box that appears, turn on Release Protection.
    Note To disable release protection for the instance, turn off Release Protection.
    Enable or disable release protection by modifying instance attributes
  6. Click OK.

When you call the ModifyInstanceAttribute operation to modify the attributes of an instance, you can enable or disable release protection for the instance by setting the DeletionProtection parameter.

Check whether release protection is enabled for an instance

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. On the Instances page, click the ID of the target instance in the Instance ID/Name column, or click Manage in the Actions column corresponding to the target instance.
  5. On the Instance Details page, check whether release protection is enabled in the Enable release protection line of the Payment Information section.
    Check whether release protection is enabled