Cloudformation nested stacks
The AWS::CloudFormation::Stack type nests a stack as a resource in a top-level template.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html
You can add output values from a nested stack within the containing template. You use the GetAtt function with the nested stack's logical name and the name of the output value in the nested stack in the format Outputs.NestedStackOutputName.
We strongly recommend that updates to nested stacks are run from the parent stack.
Complete example
curl https://aws-quickstart.s3.amazonaws.com/quickstart-bitnami-wordpress/templates/wordpress.template > wordpress.template
Snippet template
"RDSAuroraStack": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": {
"Fn::Sub": "https://${QSS3BucketName}.s3.amazonaws.com/${QSS3KeyPrefix}templates/rdsaurora.template"
},
"Parameters": {
"Subnets": {
"Fn::Join": [
",",
[
{
"Ref": "PrivateSubnet1ID"
},
{
"Ref": "PrivateSubnet2ID"
}
]
]
},
"AuroraRDSSecurityGroup": {
"Fn::GetAtt": [
"SecurityGroupsStack",
"Outputs.AuroraRDSSecurityGroup"
]
},
"DBAutoMinorVersionUpgrade": {
"Ref": "DBAutoMinorVersionUpgrade"
},
"DBBackupRetentionPeriod": {
"Ref": "DBBackupRetentionPeriod"
},
"DBPreferredBackupWindow": {
"Ref": "DBPreferredBackupWindow"
},
"DBInstanceClass": {
"Ref": "DBInstanceClass"
},
"DBMasterUserPassword": {
"Ref": "DBMasterUserPassword"
},
"DBMultiAZ": {
"Ref": "DBMultiAZ"
}
}
}
},