ALIYUN::ROS::Stack creates a nested stack. You can nest stacks up to five levels deep.
A nested stack can contain other nested stacks, forming a stack hierarchy. The root stack is the top-level parent to which all nested stacks belong, and its template is called the top-level template. Use ALIYUN::ROS::Stack to nest a stack as a resource in a top-level template.
In a nested stack template, you can pass an output of one stack as an input to another. To retrieve a nested stack output, use Fn::GetAtt with the nested stack name and output name in the Outputs.NestedStackOutputName format. Use nested stacks.
Syntax
{
"Type": "ALIYUN::ROS::Stack",
"Properties": {
"TemplateURL": String,
"TemplateBody": String,
"TemplateId": String,
"TemplateVersion": String,
"TimeoutMins": Number,
"Parameters": Map,
"ResourceGroupId": String,
"Tags": List
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
TemplateURL |
String |
No |
Yes |
The URL of the template body file. |
The template body file can be up to 524,288 bytes. The URL can be up to 1,024 bytes. The URL must point to a template on an HTTP or HTTPS web server or in an Object Storage Service (OSS) bucket, such as If the region ID of the OSS bucket is not specified, the stack's region ID is used. Specify one of |
|
TemplateBody |
Map |
No |
Yes |
The template body content for template delivery. |
The content is raw data. Functions in the template content apply only to child templates. Specify one of |
|
TemplateId |
String |
No |
Yes |
The template ID. |
Specify one of |
|
TemplateVersion |
String |
No |
Yes |
The name of the template version. |
None. |
|
TimeoutMins |
Number |
No |
Yes |
The timeout period for creating or updating the parent stack. |
Unit: minutes. Default value: 60. |
|
Parameters |
Map |
No |
Yes |
Key-value pairs representing the parameters passed to ROS when the nested stack is created. |
Each key-value pair corresponds to a parameter defined in the nested stack template. Required when the nested stack has input parameters. |
|
ResourceGroupId |
String |
No |
No |
The ID of the resource group. |
None. |
|
Tags |
List |
No |
Yes |
The tags. |
You can specify up to 20 tags. Tags properties. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
Key |
String |
Yes |
No |
The tag key. |
The tag key can be up to 128 characters. It cannot start with |
|
Value |
String |
No |
No |
The tag value. |
The tag value can be up to 128 characters. It cannot start with |
Return values
Fn::GetAtt
Use the following code to obtain the output of a nested stack:
{
"Fn::GetAtt": [
"<nested_stack>",
"Outputs.<nested_stack_output_name>"
]
}
If you use Ref to reference a nested stack resource, the Alibaba Cloud Resource Name (ARN) of the nested stack is returned. Example: arn:acs:ros::cn-hangzhou:12345****:stacks/test-nested-stack-Demo-jzkyq7mn****/e71c1e04-1a57-46fc-b9a4-cf7ce0d3****.
Examples
The following YAML and JSON examples create a child stack containing a virtual private cloud (VPC), a vSwitch, and a security group. The child stack template is stored at oss://ros/template/vpc.txt.
The following YAML and JSON examples create a parent stack: