-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathroot-stack.yaml
89 lines (89 loc) · 2.49 KB
/
root-stack.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
AWSTemplateFormatVersion: "2010-09-09"
Description: Root stack
Resources:
sshKeyPair:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/key-pair/main.yaml
devVpc:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/vpc/vpc.yaml
internetGateway:
Type: AWS::CloudFormation::Stack
DependsOn:
- devVpc
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/vpc/internet-gateway.yaml
Parameters:
vpcId:
Fn::GetAtt:
- devVpc
- Outputs.vpcId
routeTable:
Type: AWS::CloudFormation::Stack
DependsOn:
- devVpc
- internetGateway
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/vpc/route-table.yaml
Parameters:
vpcId:
Fn::GetAtt:
- devVpc
- Outputs.vpcId
internetGatewayId:
Fn::GetAtt:
- internetGateway
- Outputs.internetGatewayId
devPublicSubnet:
Type: AWS::CloudFormation::Stack
DependsOn:
- devVpc
- routeTable
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/vpc/subnet.yaml
Parameters:
vpcId:
Fn::GetAtt:
- devVpc
- Outputs.vpcId
publicSubnetRouteTableId:
Fn::GetAtt:
- routeTable
- Outputs.publicSubnetRouteTableId
ipv6CidrBlock:
Fn::GetAtt:
- devVpc
- Outputs.ipv6CidrBlock
ec2SecurityGroup:
Type: AWS::CloudFormation::Stack
DependsOn:
- devVpc
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/security-group/main.yaml
Parameters:
vpcId:
Fn::GetAtt:
- devVpc
- Outputs.vpcId
ec2Instance:
Type: AWS::CloudFormation::Stack
DependsOn:
- sshKeyPair
- devVpc
- internetGateway
- routeTable
- devPublicSubnet
- ec2SecurityGroup
Properties:
TemplateURL: https://bucket-cf-template.s3.ap-southeast-1.amazonaws.com/ec2/main.yaml
Parameters:
securityGroupId:
Fn::GetAtt:
- ec2SecurityGroup
- Outputs.securityGroupId
publicSubnetId:
Fn::GetAtt:
- devPublicSubnet
- Outputs.publicSubnetId