If you need to update a stack but the resource properties cannot be modified, you can update the stack by replacing its resource properties.

Background information

If you need to modify only the resource properties of a stack but keep the physical ID unchanged, you can modify the parameter settings of the specified stack in the template.

If you need to update a stack but the resource properties cannot be modified, you can replace the stack. To replace a stack, you must recreate the stack by using a new ID after you delete the stack. This topic describes how to update a stack by replacing it. The CidrBlock property of the ALIYUN::ECS::VSwitch resource is replaced in the example.


  1. Log on to the ROS console.
  2. Create a stack.
    Use the following template to create a stack that contains the ALIYUN::ECS::VSwitch resource. Set the CidrBlock property to

    For more information about how to create a stack, see Create a stack.

    ROSTemplateFormatVersion: '2015-09-01'
        Type: String
        Default: cn-hangzhou-i
        Type: String
        Type: ALIYUN::ECS::VPC
          VpcName: MyTestVpc
        Type: ALIYUN::ECS::VSwitch
            Ref: ZoneId
            Ref: VSwitchCidrBlock
              - EcsVpc
              - VpcId
          VSwitchName: VSwitch
    Outputs: {}
  3. Replace the stack.
    1. In the left-side navigation pane, click Stacks.
    2. In the upper-left corner, select the region where the target stack resides from the drop-down list.
    3. On the Stacks page, find the stack that you want to update and click Update in the Actions column.
    4. In the Configure Template Parameters step of the Edit Stack wizard, update the VSwitchCidrBlock value from to in the Parameters section.
    5. Click Next.
    6. In the Configure Stack step of the Edit Stack wizard, select Enable to enable replacement update.
    7. Click Confirm.
      After the replacement update is complete, the physical ID of the vSwitch resource changes. The CidrBlock value is changed from to If you want to view the resource information, click the Resources tab on the stack details page, and then click the new ID of the vSwitch resource to go to the vSwitch Details page.