-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindows1.json
More file actions
355 lines (355 loc) · 12.2 KB
/
windows1.json
File metadata and controls
355 lines (355 loc) · 12.2 KB
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This template enables roles and features of Windows Server. **WARNING** This template creates Amazon EC2 Windows instance and related resources. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
},
"InstanceType": {
"Description": "Amazon EC2 instance type",
"Type": "String",
"Default": "m5.large",
"AllowedValues": [
"t2.micro",
"t2.small",
"t2.medium",
"m3.medium",
"m3.large",
"m3.xlarge",
"m3.2xlarge",
"m5.large",
"m4.xlarge",
"m4.2xlarge",
"m4.4xlarge",
"m4.10xlarge",
"c3.large",
"c3.xlarge",
"c3.2xlarge",
"c3.4xlarge",
"c3.8xlarge",
"r3.large",
"r3.xlarge",
"r3.2xlarge",
"r3.4xlarge",
"r3.8xlarge",
"i2.xlarge",
"i2.2xlarge",
"i2.4xlarge",
"i2.8xlarge",
"d2.xlarge",
"d2.2xlarge",
"d2.4xlarge",
"d2.8xlarge"
],
"ConstraintDescription": "must be a valid EC2 instance type."
},
"Roles": {
"Description": "A SPACE seperated list of roles that you want to enable on this instance. Valid values are AD-Certificate, AD-Domain-Services, ADLDS, DHCP, DNS, Fax, File-Services, NPAS, Print-Services, Web-Server, and WDS.",
"Type": "String",
"Default": "None",
"AllowedPattern": "(((AD\\-Certificate)|(AD\\-Domain\\-Services)|(ADLDS)|(DHCP)|(DNS)|(Fax)|(File\\-Services)|(NPAS)|(Print\\-Services)|(Web\\-Server)|(WDS))( ((AD\\-Certificate)|(AD\\-Domain\\-Services)|(ADLDS)|(DHCP)|(DNS)|(Fax)|(File\\-Services)|(NPAS)|(Print\\-Services)|(Web\\-Server)|(WDS)))*)|(None)"
},
"Features": {
"Description": "A SPACE seperated list of features that you want to enable on this instance. Valid values are NET-Framework, BITS, BitLocker, BranchCache, CMAK, Desktop-Experience, DAMC, Failover-Clustering, GPMC, Ink-Handwriting, Internet-Print-Client, ISNS, LPR-Port-Monitor, MSMQ, Multipath-IO, NLB, PNRP, qWave, Remote-Assistance, RDC, RPC-over-HTTP-Proxy, Simple-TCPIP, SMTP-Server, SNMP-Services, Storage-Mgr-SANS, Subsystem-UNIX-Apps, Telnet-Client, Telnet-Server, TFTP-Client, Biometric-Framework, Windows-Internal-DB, PowerShell-ISE, Backup-Features, Migration, WSRM, TIFF-IFilter, WinRM-IIS-Ext, WINS-Server, Wireless-Networking, and XPS-Viewer.",
"Type": "String",
"Default": "None",
"AllowedPattern": "(((NET\\-Framework)|(BITS)|(BitLocker)|(BranchCache)|(CMAK)|(Desktop\\-Experience)|(DAMC)|(Failover\\-Clustering)|(GPMC)|(Ink\\-Handwriting)|(Internet\\-Print\\-Client)|(ISNS)|(LPR\\-Port\\-Monitor)|(MSMQ)|(Multipath\\-IO)|(NLB)|(PNRP)|(qWave)|(Remote\\-Assistance)|(RDC)|(RPC\\-over\\-HTTP\\-Proxy)|(Simple\\-TCPIP)|(SMTP\\-Server)|(SNMP\\-Services)|(Storage\\-Mgr\\-SANS)|(Subsystem\\-UNIX\\-Apps)|(Telnet\\-Client)|(Telnet\\-Server)|(TFTP\\-Client)|(Biometric\\-Framework)|(Windows\\-Internal\\-DB)|(PowerShell\\-ISE)|(Backup\\-Features)|(Migration)|(WSRM)|(TIFF\\-IFilter)|(WinRM\\-IIS\\-Ext)|(WINS\\-Server)|(Wireless\\-Networking)|(XPS\\-Viewer))( ((NET\\-Framework)|(BITS)|(BitLocker)|(BranchCache)|(CMAK)|(Desktop\\-Experience)|(DAMC)|(Failover\\-Clustering)|(GPMC)|(Ink\\-Handwriting)|(Internet\\-Print\\-Client)|(ISNS)|(LPR\\-Port\\-Monitor)|(MSMQ)|(Multipath\\-IO)|(NLB)|(PNRP)|(qWave)|(Remote\\-Assistance)|(RDC)|(RPC\\-over\\-HTTP\\-Proxy)|(Simple\\-TCPIP)|(SMTP\\-Server)|(SNMP\\-Services)|(Storage\\-Mgr\\-SANS)|(Subsystem\\-UNIX\\-Apps)|(Telnet\\-Client)|(Telnet\\-Server)|(TFTP\\-Client)|(Biometric\\-Framework)|(Windows\\-Internal\\-DB)|(PowerShell\\-ISE)|(Backup\\-Features)|(Migration)|(WSRM)|(TIFF\\-IFilter)|(WinRM\\-IIS\\-Ext)|(WINS\\-Server)|(Wireless\\-Networking)|(XPS\\-Viewer)))*( )*)|(None)"
},
"SourceCidrForRDP": {
"Description": "IP Cidr from which you are likely to RDP into the instances. You can add rules later by modifying the created security groups e.g. 54.32.98.160/32",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"AllowedPattern": "^([0-9]+\\.){3}[0-9]+\\/[0-9]+$"
}
},
"Mappings": {
"AWSRegion2AMI": {
"us-east-1": {
"Windows2008r2": "ami-05053a58f18d79165",
"Windows2012r2": "ami-066663db63b3aa675"
},
"us-west-2": {
"Windows2008r2": "ami-09baf7dca5abb5477",
"Windows2012r2": "ami-07c77fe35092981e9"
},
"us-west-1": {
"Windows2008r2": "ami-0103343efe39caae9",
"Windows2012r2": "ami-08462bc4d6a8eb5c1"
},
"eu-west-1": {
"Windows2008r2": "ami-0146d7f51c6677e99",
"Windows2012r2": "ami-009af7c43be38087d"
},
"eu-west-2": {
"Windows2008r2": "ami-0c83c0bcaf872d604",
"Windows2012r2": "ami-025fc1fa28fdf1a87"
},
"eu-west-3": {
"Windows2008r2": "ami-03af3787c0ef4ca0d",
"Windows2012r2": "ami-0cbc109ce3fe6584e"
},
"eu-central-1": {
"Windows2008r2": "ami-098bba2f7c9962b56",
"Windows2012r2": "ami-0ece2db131cd3c16a"
},
"eu-north-1": {
"Windows2008r2": "ami-0da3dcb725fd36774",
"Windows2012r2": "ami-01e97bc0f89e9ca04"
},
"ap-northeast-1": {
"Windows2008r2": "ami-085b9d0f82b3d500b",
"Windows2012r2": "ami-0d99aa7f0403a9ba4"
},
"ap-northeast-2": {
"Windows2008r2": "ami-05d7911c701557f98",
"Windows2012r2": "ami-0163c75ba997507aa"
},
"ap-northeast-3": {
"Windows2008r2": "ami-0b9d45b41271b9dff",
"Windows2012r2": "ami-0646ac68d679b1b73"
},
"ap-southeast-1": {
"Windows2008r2": "ami-08cde6692201557a8",
"Windows2012r2": "ami-00230cfcbc0180362"
},
"ap-southeast-2": {
"Windows2008r2": "ami-0e17bfe822c550bff",
"Windows2012r2": "ami-0f66d840816e8a35f"
},
"ap-south-1": {
"Windows2008r2": "ami-033ede8dc37ea7fb6",
"Windows2012r2": "ami-0437fea2a5ba5aacd"
},
"us-east-2": {
"Windows2008r2": "ami-0ccd4940b0cd75ce3",
"Windows2012r2": "ami-00890851afd74dda3"
},
"ca-central-1": {
"Windows2008r2": "ami-0ce5dfea946fa499d",
"Windows2012r2": "ami-051f75c651d856381"
},
"sa-east-1": {
"Windows2008r2": "ami-0876972eb2541a9d5",
"Windows2012r2": "ami-0f7eee4d47377680e"
},
"cn-north-1": {
"Windows2008r2": "ami-04d3dc91707f96a37",
"Windows2012r2": "ami-0524bf2ce3a8bab46"
},
"cn-northwest-1": {
"Windows2008r2": "ami-006c99da93a40e535",
"Windows2012r2": "ami-0ce900e3a255d57a2"
}
}
},
"Resources": {
"InstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Enable RDP",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "3389",
"ToPort": "3389",
"CidrIp": {
"Ref": "SourceCidrForRDP"
}
}
]
}
},
"WindowsServer": {
"Type": "AWS::EC2::Instance",
"Metadata": {
"AWS::CloudFormation::Init": {
"config": {
"files": {
"c:\\cfn\\cfn-hup.conf": {
"content": {
"Fn::Join": [
"",
[
"[main]\n",
"stack=",
{
"Ref": "AWS::StackId"
},
"\n",
"region=",
{
"Ref": "AWS::Region"
},
"\n"
]
]
}
},
"c:\\cfn\\hooks.d\\cfn-auto-reloader.conf": {
"content": {
"Fn::Join": [
"",
[
"[cfn-auto-reloader-hook]\n",
"triggers=post.update\n",
"path=Resources.WindowsServer.Metadata.AWS::CloudFormation::Init\n",
"action=cfn-init.exe -v -s ",
{
"Ref": "AWS::StackId"
},
" -r WindowsServer",
" --region ",
{
"Ref": "AWS::Region"
},
"\n"
]
]
}
}
},
"commands": {
"1-install-roles": {
"command": {
"Fn::Join": [
"",
[
"if not \"None\" EQU \"",
{
"Ref": "Roles"
},
"\" (servermanagercmd -install ",
{
"Ref": "Roles"
},
" -restart)"
]
]
}
},
"2-install-features": {
"command": {
"Fn::Join": [
"",
[
"if not \"None\" EQU \"",
{
"Ref": "Features"
},
"\" (servermanagercmd -install ",
{
"Ref": "Features"
},
" -restart)"
]
]
}
},
"3-signal-success": {
"command": {
"Fn::Join": [
"",
[
"cfn-signal.exe -e %ERRORLEVEL% \"",
{
"Fn::Base64": {
"Ref": "WindowsServerWaitHandle"
}
},
"\""
]
]
}
}
},
"services": {
"windows": {
"cfn-hup": {
"enabled": "true",
"ensureRunning": "true",
"files": [
"c:\\cfn\\cfn-hup.conf",
"c:\\cfn\\hooks.d\\cfn-auto-reloader.conf"
]
}
}
}
}
}
},
"Properties": {
"InstanceType": {
"Ref": "InstanceType"
},
"ImageId": {
"Fn::FindInMap": [
"AWSRegion2AMI",
{
"Ref": "AWS::Region"
},
"Windows2008r2"
]
},
"SecurityGroups": [
{
"Ref": "InstanceSecurityGroup"
}
],
"KeyName": {
"Ref": "KeyName"
},
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"<script>\n",
"cfn-init.exe -v -s ",
{
"Ref": "AWS::StackId"
},
" -r WindowsServer",
" --region ",
{
"Ref": "AWS::Region"
},
"\n",
"</script>"
]
]
}
}
}
},
"WindowsServerWaitHandle": {
"Type": "AWS::CloudFormation::WaitConditionHandle"
},
"WindowsServerWaitCondition": {
"Type": "AWS::CloudFormation::WaitCondition",
"DependsOn": "WindowsServer",
"Properties": {
"Handle": {
"Ref": "WindowsServerWaitHandle"
},
"Timeout": "1800"
}
}
},
"Outputs": {
"RolesEnabled": {
"Value": {
"Ref": "Roles"
},
"Description": "Roles enabled on this instance."
},
"FeaturesEnabled": {
"Value": {
"Ref": "Features"
},
"Description": "Features enabled on this instance."
}
}
}