Skip to content

Commit d92ae9b

Browse files
committed
Move files around
1 parent 754b4bc commit d92ae9b

File tree

344 files changed

+2505
-2847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+2505
-2847
lines changed
File renamed without changes.
File renamed without changes.
Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
{
2+
"AWSTemplateFormatVersion": "2010-09-09",
3+
"Description": "Create a variable number of EC2 instance resources.",
4+
"Parameters": {
5+
"KeyName": {
6+
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
7+
"Type": "AWS::EC2::KeyPair::KeyName",
8+
"Default": "slinger_testing",
9+
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
10+
},
11+
"InstanceName": {
12+
"Description": "Name of EC2 instance",
13+
"Type": "String",
14+
"ConstraintDescription": "must be a valid EC2 instance string name."
15+
},
16+
"InstanceType": {
17+
"Description": "Basic EC2 instance type",
18+
"Type": "String",
19+
"AllowedValues": [
20+
"t1.micro",
21+
"t2.nano",
22+
"t2.micro",
23+
"t2.small",
24+
"t2.medium",
25+
"t2.large",
26+
"m1.small",
27+
"m1.medium",
28+
"m1.large",
29+
"m1.xlarge",
30+
"m2.xlarge",
31+
"m2.2xlarge",
32+
"m2.4xlarge",
33+
"m3.medium",
34+
"m3.large",
35+
"m3.xlarge",
36+
"m3.2xlarge",
37+
"m4.large",
38+
"m4.xlarge",
39+
"m4.2xlarge",
40+
"m4.4xlarge",
41+
"m4.10xlarge",
42+
"c1.medium",
43+
"c1.xlarge",
44+
"c3.large",
45+
"c3.xlarge",
46+
"c3.2xlarge",
47+
"c3.4xlarge",
48+
"c3.8xlarge",
49+
"c4.large",
50+
"c4.xlarge",
51+
"c4.2xlarge",
52+
"c4.4xlarge",
53+
"c4.8xlarge",
54+
"g2.2xlarge",
55+
"g2.8xlarge",
56+
"r3.large",
57+
"r3.xlarge",
58+
"r3.2xlarge",
59+
"r3.4xlarge",
60+
"r3.8xlarge",
61+
"i2.xlarge",
62+
"i2.2xlarge",
63+
"i2.4xlarge",
64+
"i2.8xlarge",
65+
"d2.xlarge",
66+
"d2.2xlarge",
67+
"d2.4xlarge",
68+
"d2.8xlarge",
69+
"hs1.8xlarge",
70+
"cr1.8xlarge",
71+
"cc2.8xlarge"
72+
],
73+
"Default": "c4.2xlarge",
74+
"ConstraintDescription": "must be a valid EC2 instance type."
75+
},
76+
"ImageId": {
77+
"Description": "Basic instance ami",
78+
"Type": "AWS::EC2::Image::Id"
79+
},
80+
"VpcId": {
81+
"Description": "VpcId of your existing Virtual Private Cloud (VPC)",
82+
"Type": "String"
83+
},
84+
"SubnetId": {
85+
"Description": "SubnetId of an existing subnet in your Virtual Private Cloud (VPC)",
86+
"Type": "String"
87+
},
88+
"SSHLocation": {
89+
"Description": " The IP address range that can be used to SSH to the EC2 instances",
90+
"Type": "String",
91+
"Default": "0.0.0.0/0",
92+
"MinLength": "9",
93+
"MaxLength": "18",
94+
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
95+
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
96+
},
97+
"BudgetCode": {
98+
"Description": " Budget code to save money",
99+
"Type": "String",
100+
"Default": "A019517",
101+
"ConstraintDescription": "must be a valid budget code."
102+
},
103+
"LaunchPlatform": {
104+
"Description": " Mark current platform",
105+
"Type": "String",
106+
"Default": "bitstorm_dev",
107+
"ConstraintDescription": "must be a valid platform like bitstorm_qc bitstorm_dev bitstorm_staggin bitstorm_live."
108+
},
109+
"LaunchUser": {
110+
"Description": " Mark current tester",
111+
"Type": "String",
112+
"Default": "null",
113+
"ConstraintDescription": "must be a valid and existing tester."
114+
},
115+
"TestID": {
116+
"Description": " Mark current testcase",
117+
"Type": "String",
118+
"ConstraintDescription": "must be a valid and existing testcase id."
119+
},
120+
"TestTarget": {
121+
"Description": " Mark current test target",
122+
"Type": "String",
123+
"ConstraintDescription": "must be a valid and existing test target name."
124+
},
125+
"AgentID": {
126+
"Description": " Mark current agent",
127+
"Type": "String"
128+
},
129+
"IsMaster": {
130+
"Description": "Mark master agent",
131+
"Type": "String",
132+
"Default": "False"
133+
},
134+
"MasterID": {
135+
"Description": "Mark master ID",
136+
"Type": "String",
137+
"Default": "null"
138+
}
139+
},
140+
"Mappings": {},
141+
"Resources": {
142+
"KWOSInstance": {
143+
"Type": "AWS::EC2::Instance",
144+
"Metadata": {
145+
"AWS::CloudFormation::Init": {}
146+
},
147+
"Properties": {
148+
"ImageId": {
149+
"Ref": "ImageId"
150+
},
151+
"InstanceType": {
152+
"Ref": "InstanceType"
153+
},
154+
"SubnetId": {
155+
"Ref": "SubnetId"
156+
},
157+
"SecurityGroupIds": [
158+
{
159+
"Ref": "KWOSSecurityGroup"
160+
}
161+
],
162+
"KeyName": {
163+
"Ref": "KeyName"
164+
},
165+
"Tags": [
166+
{
167+
"Key": "LaunchPlatform",
168+
"Value": {
169+
"Ref": "LaunchPlatform"
170+
}
171+
},
172+
{
173+
"Key": "LaunchUser",
174+
"Value": {
175+
"Ref": "LaunchUser"
176+
}
177+
},
178+
{
179+
"Key": "TestID",
180+
"Value": {
181+
"Ref": "TestID"
182+
}
183+
},
184+
{
185+
"Key": "Name",
186+
"Value": {
187+
"Ref": "InstanceName"
188+
}
189+
},
190+
{
191+
"Key": "BudgetCode",
192+
"Value": {
193+
"Ref": "BudgetCode"
194+
}
195+
},
196+
{
197+
"Key": "TestTarget",
198+
"Value": {
199+
"Ref": "TestTarget"
200+
}
201+
},
202+
{
203+
"Key": "AgentID",
204+
"Value": {
205+
"Ref": "AgentID"
206+
}
207+
},
208+
{
209+
"Key": "IsMaster",
210+
"Value": {
211+
"Ref": "IsMaster"
212+
}
213+
},
214+
{
215+
"Key": "MasterID",
216+
"Value": {
217+
"Ref": "MasterID"
218+
}
219+
}
220+
],
221+
"Monitoring": false,
222+
"UserData": {
223+
"Fn::Base64": {
224+
"Fn::Join": [
225+
"",
226+
[
227+
"#!/bin/bash\n",
228+
"apt-get -y install python-pip\n",
229+
"pip install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n",
230+
"# Helper function\n",
231+
"function error_exit\n",
232+
"{\n",
233+
" /usr/local/bin/cfn-signal -e 1 -r \"$1\" '",
234+
{
235+
"Ref": "KWOSWaitHandle"
236+
},
237+
"'\n",
238+
" exit 1\n",
239+
"}\n",
240+
"# Install the basic system configuration\n",
241+
"/usr/local/bin/cfn-init -s ",
242+
{
243+
"Ref": "AWS::StackId"
244+
},
245+
" -r KWOSInstance ",
246+
" --region ",
247+
{
248+
"Ref": "AWS::Region"
249+
},
250+
" || error_exit 'Failed to run cfn-init'\n",
251+
"# All done so signal success\n",
252+
"/usr/local/bin/cfn-signal -e 0 -r \"KWOS setup complete\" '",
253+
{
254+
"Ref": "KWOSWaitHandle"
255+
},
256+
"'\n"
257+
]
258+
]
259+
}
260+
}
261+
}
262+
},
263+
"KWOSWaitHandle": {
264+
"Type": "AWS::CloudFormation::WaitConditionHandle"
265+
},
266+
"KWOSWaitCondition": {
267+
"Type": "AWS::CloudFormation::WaitCondition",
268+
"Properties": {
269+
"Handle": {
270+
"Ref": "KWOSWaitHandle"
271+
},
272+
"Timeout": "300"
273+
}
274+
},
275+
"KWOSSecurityGroup": {
276+
"Type": "AWS::EC2::SecurityGroup",
277+
"Properties": {
278+
"VpcId": {
279+
"Ref": "VpcId"
280+
},
281+
"GroupDescription": "Enable HTTP access via port 80/22/443 and ICMP access via port *",
282+
"SecurityGroupIngress": [
283+
{
284+
"IpProtocol": "tcp",
285+
"FromPort": "80",
286+
"ToPort": "80",
287+
"CidrIp": "0.0.0.0/0"
288+
},
289+
{
290+
"IpProtocol": "tcp",
291+
"FromPort": "8888",
292+
"ToPort": "8888",
293+
"CidrIp": "0.0.0.0/0"
294+
},
295+
{
296+
"IpProtocol": "tcp",
297+
"FromPort": "443",
298+
"ToPort": "443",
299+
"CidrIp": "0.0.0.0/0"
300+
},
301+
{
302+
"IpProtocol": "icmp",
303+
"FromPort": "-1",
304+
"ToPort": "-1",
305+
"CidrIp": "0.0.0.0/0"
306+
},
307+
{
308+
"IpProtocol": "tcp",
309+
"FromPort": "22",
310+
"ToPort": "22",
311+
"CidrIp": {
312+
"Ref": "SSHLocation"
313+
}
314+
}
315+
]
316+
}
317+
}
318+
},
319+
"Outputs": {
320+
"WebsiteURL": {
321+
"Description": "URL for newly created KWOS deploy stack",
322+
"Value": {
323+
"Fn::Join": [
324+
"",
325+
[
326+
"http://",
327+
{
328+
"Fn::GetAtt": [
329+
"KWOSInstance",
330+
"PublicDnsName"
331+
]
332+
}
333+
]
334+
]
335+
}
336+
},
337+
"InstanceId": {
338+
"Description": "Instance Id of newly created instance",
339+
"Value": {
340+
"Ref": "KWOSInstance"
341+
}
342+
}
343+
}
344+
}

0 commit comments

Comments
 (0)