This topic describes the common commands that you can run in Template Transformer of Resource Orchestration Service (ROS).
View help information
Run the following command to view the help information about Template Transformer:
rostran --help
Convert a template
Run the following command to convert a template:
rostran transform SOURCE_PATH [OPTIONS]
The following table describes the parameters in the command.
Parameter | Required | Description |
| Yes | The path in which the original template file is stored. The original template can be an Excel, Terraform, or AWS CloudFormation template. |
| No | Valid values:
|
The following items provide examples of converting different types of templates to ROS templates:
Format a template
Run the following code to format a template:
rostran format [OPTIONS] PATH...
The following tables describe the parameters in the code.
Parameter | Required | Description |
| Yes | The path of the ROS template file that you want to format. Note You can specify multiple template file paths. |
| No | Valid values:
|
Formatting rules
The sections of a template are formatted in the following sequence: ROSTemplateFormatVersion
, Transform
, Description
, Conditions
, Mappings
, Parameters
, Resources
, Outputs
, Metadata
, and Workspace
.
The following items describe the sorting order for data in each template section:
Conditions
: Conditions are sorted in ascending alphabetical order.Mappings
: Mappings are sorted in ascending alphabetical order.Parameters
: Parameters are sorted based on the sequence that is defined inMetadata.ALIYUN::ROS::Interface.ParameterGroups.Parameters
. If Metadata.ALIYUN::ROS::Interface.ParameterGroups.Parameters is not defined, the parameters are not sorted. The properties of each parameter are sorted in specific orders, such as in the order of type, description, and constraint.Resources
: Resources are sorted in the order of the resource dependency. Dependencies are arranged before resources. Resource properties are sorted in the default order.Outputs
: Output properties are sorted in the following order:Description
,Condition
, andValue
.Metadata
: Metadata entries are sorted in the following order:ALIYUN::ROS::Interface
,ALIYUN::ROS::Designer
, andPredefinedParameters
. The properties of each metadata entry are sorted in the default order.Workspace
: Workspaces are sorted in ascending alphabetical order.main.tf
is arranged in the first place.