forked from msangui/aws-cloudformation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nested-stacks.template.json
63 lines (63 loc) · 1.46 KB
/
nested-stacks.template.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Nested Stacks",
"Parameters": {
"KeyName": {
"Description": "Existing KeyPair",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "Must be an existing key pair"
},
"VPCCIDR": {
"Description": "VPC CIDR",
"Type": "String",
"Default": "10.0.0.0/16",
},
"SubnetCIDR": {
"Description": "Subnet CIDR",
"Type": "String",
"Default": "10.0.2.0/24",
}
},
"Resources": {
"VPCStack": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": "https://s3.amazonaws.com/.../VPC.template.json",
"Parameters": {
"KeyPairName": {
"Ref": "KeyName"
},
"VPCCIDR": {
"Ref": "VPCCIDR"
},
"SubnetCIDR": {
"Ref": "SubnetCIDR"
}
}
}
},
"DatabaseStack": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": "https://s3.amazonaws.com/.../Database.template.json",
"Parameters": {
"KeyPairName": {
"Ref": "KeyName"
},
"SubnetId": {
"Fn::GetAtt": [
"VPCStack",
"Outputs.SubnetId"
]
},
"VPCId": {
"Fn::GetAtt": [
"VPCStack",
"Outputs.VPCId"
]
}
}
}
}
}
}