-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfn-master-stack
283 lines (283 loc) · 9.12 KB
/
cfn-master-stack
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
AWSTemplateFormatVersion: 2010-09-09
Resources:
Manstack:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/bucket location for management cfn-nested-mgmt'
Parameters:
VPCCIDRman: !Ref VPCCIDRman
PublicSubnetCIDRman: !Ref PublicSubnetCIDRman
PrivateSubnetCIDRman1: !Ref PrivateSubnetCIDRman1
PrivateSubnetCIDRman2: !Ref PrivateSubnetCIDRman2
AvailabilityZone1: !Ref AvailabilityZone1
AvailabilityZone2: !Ref AvailabilityZone2
EnvType: !Ref EnvType
Tagname: !Ref Tagname
KeyPairName: !Ref KeyPairName
Metadata:
'AWS::CloudFormation::Designer':
id: 3d395472-c589-4a50-a1a4-158aef22f91f
Prodstack:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/bucket location for production cfn-nested-prod'
Parameters:
VPCCIDRprod: !Ref VPCCIDRprod
PublicSubnetCIDRprod: !Ref PublicSubnetCIDRprod
PrivateSubnetCIDRprod1: !Ref PrivateSubnetCIDRprod1
PrivateSubnetCIDRprod2: !Ref PrivateSubnetCIDRprod2
AvailabilityZone1: !Ref AvailabilityZone1
AvailabilityZone2: !Ref AvailabilityZone2
EnvType: !Ref EnvType
Tagname: !Ref Tagname
KeyPairName: !Ref KeyPairName
Metadata:
'AWS::CloudFormation::Designer':
id: 6734602c-49ef-4103-804e-54fcf3a2083e
DependsOn:
- Devstack
Devstack:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/bucket location for development cfn-nested-dev'
Parameters:
VPCCIDRdev: !Ref VPCCIDRdev
PublicSubnetCIDRdev: !Ref PublicSubnetCIDRdev
PrivateSubnetCIDRdev: !Ref PrivateSubnetCIDRdev
DBSubnetCIDR: !Ref DBSubnetCIDR
AvailabilityZone1: !Ref AvailabilityZone1
AvailabilityZone2: !Ref AvailabilityZone2
AvailabilityZone3: !Ref AvailabilityZone3
EnvType: !Ref EnvType
Tagname: !Ref Tagname
KeyPairName: !Ref KeyPairName
DBName: !Ref DBName
DBUsername: !Ref DBUsername
DBPassword: !Ref DBPassword
DBClass: !Ref DBClass
DBAllocatedStorage: !Ref DBAllocatedStorage
Metadata:
'AWS::CloudFormation::Designer':
id: 6f443d94-954c-47c1-aafe-bb8a73aa8e24
DependsOn:
- Manstack
VPCpeering:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: 'https://s3.amazonaws.com/bucket location for the vpc peering stack'
Parameters:
VPCidman: !GetAtt
- Manstack
- Outputs.VPCIDmanstk
VPCiddev: !GetAtt
- Devstack
- Outputs.VPCIDdevstk
VPCidprod: !GetAtt
- Prodstack
- Outputs.VPCIDprodstk
RouteTableidpubman: !GetAtt
- Manstack
- Outputs.RouteTableIDpubmanstk
RouteTableidpriman1: !GetAtt
- Manstack
- Outputs.RouteTableIDpriman1stk
RouteTableidpriman2: !GetAtt
- Manstack
- Outputs.RouteTableIDpriman2stk
RouteTableidpubdev: !GetAtt
- Devstack
- Outputs.RouteTableIDpubdevstk
RouteTableidpridev: !GetAtt
- Devstack
- Outputs.RouteTableIDpridevstk
RouteTableidpubprod: !GetAtt
- Prodstack
- Outputs.RouteTableIDpubprodstk
RouteTableidpriprod1: !GetAtt
- Prodstack
- Outputs.RouteTableIDpriprod1stk
RouteTableidpriprod2: !GetAtt
- Prodstack
- Outputs.RouteTableIDpriprod2stk
Metadata:
'AWS::CloudFormation::Designer':
id: 473355d1-d871-4185-9713-897504213b3d
DependsOn:
- Prodstack
Parameters:
VPCCIDRman:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/16
PublicSubnetCIDRman:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.0.0/24
PrivateSubnetCIDRman1:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.1.0/24
PrivateSubnetCIDRman2:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.0.2.0/24
AvailabilityZone1:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 1 for for subnet
AvailabilityZone2:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 2 for subnet
EnvType:
Description: ' This Block is for common tag work in value for all the resource'
Type: String
Default: manangement env
Tagname:
Description: Customer Name for reference tags
Type: String
Default: management env
KeyPairName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
Type: 'AWS::EC2::KeyPair::KeyName'
ConstraintDescription: must be the name of an existing EC2 KeyPair.
VPCCIDRprod:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.2.0.0/16
PublicSubnetCIDRprod:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.2.0.0/24
PrivateSubnetCIDRprod1:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.2.1.0/24
PrivateSubnetCIDRprod2:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.2.2.0/24
VPCCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.1.0.0/16
PublicSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.1.0.0/24
PrivateSubnetCIDRdev:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.1.1.0/24
DBSubnetCIDR:
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
Description: ' This Block is for VPC CIDR (X.X.X.X/X)'
Type: String
Default: 10.1.2.0/24
AvailabilityZone3:
Type: 'AWS::EC2::AvailabilityZone::Name'
Description: Select AZ 3 for subnet
DBName:
Default: MyDatabase
Description: The database name
Type: String
MinLength: '1'
MaxLength: '64'
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric characters.
DBUsername:
Default: admin
NoEcho: 'true'
Description: The database admin account username
Type: String
MinLength: '1'
MaxLength: '16'
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
ConstraintDescription: must begin with a letter and contain only alphanumeric characters.
DBPassword:
Default: admin
NoEcho: 'true'
Description: The database admin account password
Type: String
MinLength: '1'
MaxLength: '41'
AllowedPattern: '[a-zA-Z0-9]*'
ConstraintDescription: must contain only alphanumeric characters.
DBClass:
Default: db.m1.small
Description: Database instance class
Type: String
AllowedValues:
- db.m1.small
- db.m1.large
- db.m1.xlarge
- db.m2.xlarge
- db.m2.2xlarge
- db.m2.4xlarge
ConstraintDescription: must select a valid database instance type.
DBAllocatedStorage:
Default: '5'
Description: The size of the database (Gb)
Type: Number
MinValue: '5'
MaxValue: '1024'
ConstraintDescription: must be between 5 and 1024Gb.
Metadata:
'AWS::CloudFormation::Designer':
3d395472-c589-4a50-a1a4-158aef22f91f:
size:
width: 60
height: 60
position:
x: 330
'y': 60
z: 1
embeds: []
6f443d94-954c-47c1-aafe-bb8a73aa8e24:
size:
width: 60
height: 60
position:
x: 330
'y': 210
z: 1
embeds: []
dependson:
- 3d395472-c589-4a50-a1a4-158aef22f91f
6734602c-49ef-4103-804e-54fcf3a2083e:
size:
width: 60
height: 60
position:
x: 330
'y': 370
z: 1
embeds: []
dependson:
- 6f443d94-954c-47c1-aafe-bb8a73aa8e24
473355d1-d871-4185-9713-897504213b3d:
size:
width: 60
height: 60
position:
x: 50
'y': 190
z: 1
embeds: []
dependson:
- 6734602c-49ef-4103-804e-54fcf3a2083e
019d8cd2-04a3-42fa-8bb4-6354ecd9b09c:
source:
id: 473355d1-d871-4185-9713-897504213b3d
target:
id: 6734602c-49ef-4103-804e-54fcf3a2083e
z: 11