Validates a template by using a template URL or template body. The template is used to create a stack.
Operation description
In this example, a template that you want to use to create a stack is validated. TemplateURL
is set to oss://ros/template/demo
.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TemplateURL | string | No | The URL of the file that contains the template body. The URL must point to a template that is located on an HTTP web server or in an Object Storage Service (OSS) bucket, such as oss://ros/template/demo or oss://ros/template/demo?RegionId=cn-hangzhou. The template body can be up to 524,288 bytes in length. Note
If you do not specify the region ID of the OSS bucket, the value of RegionId is used.
You can specify one of TemplateBody and TemplateURL, but not both of them. The URL can be up to 1,024 bytes in length.\ | oss://ros/template/demo |
RegionId | string | No | The region ID of the template. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
TemplateBody | string | No | The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. | {"ROSTemplateFormatVersion":"2015-09-01"} |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can be up to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). For more information, see Ensure idempotence. | 123e4567-e89b-12d3-a456-42665544**** |
ValidationOption | string | No | Specifies whether to enable additional validation for the template. Valid values:
Note
Compared with the EnableTerraformValidation method, the EnableFastTerraformValidation method validates a template at a faster speed but a lower integrity level.
| None |
UpdateInfoOptions | array | No | The options that are used to control the generation of information about the stack update. You can specify up to two options. | |
string | No | The option that is used to control the generation of information about the stack update. Valid values:
| ConsiderCondition |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"Description": "No description",
"Parameters": [
[
{
"Description": "",
"Label": "param_integer",
"NoEcho": "false",
"ParameterKey": "param_integer",
"Type": "Number"
},
{
"Description": "",
"Label": "param_float",
"NoEcho": "false",
"ParameterKey": "param_float",
"Type": "Number"
}
]
],
"RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
"Outputs": [
{
"OutputKey": "instance_id",
"Description": "The instance ID of my ECS.",
"Label": "Instance ID"
}
],
"ResourceTypes": {
"Resources": [
"ALIYUN::ECS::InstanceGroup"
],
"DataSources": [
"DATASOURCE::VPC::Vpcs"
]
},
"Resources": [
{
"ResourceType": "ALIYUN::ECS::InstanceGroup",
"ResourcePath": "server",
"LogicalResourceIdPattern": "server"
}
],
"UpdateInfo": {
"ParametersAllowedToBeModified": [
"param1"
],
"ParametersCauseInterruptionIfModified": [
"param1"
],
"ParametersConditionallyAllowedToBeModified": [
"param2"
],
"ParametersConditionallyCauseInterruptionIfModified": [
"param2"
],
"ParametersNotAllowedToBeModified": [
"param3"
],
"ParametersUncertainlyAllowedToBeModified": [
"param4"
],
"ParametersUncertainlyCauseInterruptionIfModified": [
"param4"
],
"ParametersCauseReplacementIfModified": [
"param5"
],
"ParametersConditionallyCauseReplacementIfModified": [
"param6"
],
"ParametersUncertainlyCauseReplacementIfModified": [
"param7"
]
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-07-27 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2023-03-28 | The internal configuration of the API is changed, but the call is not affected | View Change Details |