ROS allows you to create stacks by using change sets. You can create change sets by calling an API operation or using Alibaba Cloud CLI. You can check and modify the stacks before executing change sets. The new stacks become valid only after the change sets are executed.

Create a stack by calling an API operation

You can call the CreateChangeSet operation to create a change set for a new stack and call the PreviewStack operation to preview the stack configuration.

If a stack is created when you create a change set, the stack will be in the REVIEW_IN_PROGRESS state. You cannot create new change sets for a stack in this state. If the new stack does not meet the configuration requirements, you can delete the stack and create a new change set to create another stack.

Create a stack through Alibaba Cloud CLI

You can use the aliyun ros CreateChangeSet command to create a stack.

When you create a stack by creating a change set, you must set the ChangeSetType parameter to CREATE and specify the stack name, template, stack parameters, and change set name. In the following example, a stack named test-create-change-set and a change set named test-create-change-set are created:

aliyun ros CreateChangeSet --ChangeSetType CREATE --TemplateURL oss://ros-templates/test-change-set.json? RegionId=cn-hangzhou --StackName test-create-change-set --ChangeSetName test-create-change-set --Parameters.1.ParameterKey Count --Parameters.1.ParameterValue 1