If you want to update a stack resource but you cannot change the resource property, you can perform a replacement update for the resource in the Resource Orchestration Service (ROS) console.
Background information
If you want to change only the resource property of a stack resource but remain the physical ID of the resource unchanged, you can modify the parameter settings in the stack template.
If you want to update a stack resource but you cannot change the resource property, you can use the replacement update feature to replace the resource property. For a replacement update, the existing resource is deleted, a new resource is created, and the physical ID of the resource is changed. This topic describes how to perform a replacement update for a stack resource. In this example, the CidrBlock property of the ALIYUN::ECS::VSwitch
resource is replaced.
Procedure
Log on to the ROS console.
Create a stack.
Use the following template to create a stack that contains the
ALIYUN::ECS::VSwitch
resource. In this template, the CidrBlock property is set to 172.16.100.0/24.For more information about how to create a stack, see Create a stack.
ROSTemplateFormatVersion: '2015-09-01' Parameters: ZoneId: Type: String Default: cn-hangzhou-i VSwitchCidrBlock: Type: String Default: 172.16.100.0/24 Resources: EcsVpc: Type: ALIYUN::ECS::VPC Properties: CidrBlock: 172.16.0.0/12 VpcName: MyTestVpc VSwitch: Type: ALIYUN::ECS::VSwitch Properties: ZoneId: Ref: ZoneId CidrBlock: Ref: VSwitchCidrBlock VpcId: Fn::GetAtt: - EcsVpc - VpcId VSwitchName: VSwitch Outputs: {}
Perform a replacement update on the stack.
In the left-side navigation pane, click Stacks.
In the top navigation bar, select the region where the stack you want to manage resides from the region drop-down list. For example, you can select China (Hangzhou).
On the Stacks page, find the stack and click Update in the Actions column.
In the Configure Template Parameters section of the Configure Parameters step, update the value of
VSwitchCidrBlock
from 172.16.100.0/24 to 172.16.200.0/24.In the Configure Stack Settings section, set the Whether to enable replacement update parameter to Enable to enable the replacement update feature.
Click Confirm.
After the replacement update is complete, the physical ID of the vSwitch is changed. The CidrBlock property of the vSwitch is updated from 172.16.100.0/24 to 172.16.200.0/24. If you want to view the vSwitch details, click the Resources tab on the stack details page, and click the new ID of the vSwitch to go to the details page.