forked from trovares/pyxgt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfxgt.json
157 lines (151 loc) · 6.66 KB
/
cfxgt.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
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"License": "Apache-2.0"
},
"Description": "Create an AWS EC2 instance running the AWS Linux AMI.",
"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": "AWS EC2 instance type",
"Type": "String",
"Default": "t3a.medium",
"AllowedValues": [
"t3.nano", "t3.micro", "t3.small", "t3.medium", "t3.large",
"t3.xlarge", "t3.2xlarge",
"t3a.nano", "t3a.micro", "t3a.small", "t3a.medium", "t3a.large",
"t3a.xlarge", "t3a.2xlarge",
"t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large",
"t2.xlarge", "t2.2xlarge",
"a1.medium", "a1.large", "a1.xlarge", "a1.2xarge", "a1.4xlarge", "a1.metal",
"m6i.large", "m6i.xlarge", "m6i.2xlarge", "m6i.4xlarge",
"m6i.8xlarge", "m6i.12xlarge", "m6i.16xlarge",
"m6i.24xlarge", "m6i.32xlarge",
"m5.large", "m5.xlarge", "m5.2xlarge", "m5.4xlarge",
"m5.8xlarge", "m5.12xlarge", "m5.16xlarge", "m5.24xlarge",
"m5d.large", "m5d.xlarge", "m5d.2xlarge", "m5d.4xlarge",
"m5d.8xlarge", "m5d.12xlarge", "m5d.16xlarge", "m5d.24xlarge",
"m5a.large", "m5a.xlarge", "m5a.2xlarge", "m5a.4xlarge",
"m5a.8xlarge", "m5a.12xlarge", "m5a.16xlarge", "m5a.24xlarge",
"m5ad.large", "m5ad.xlarge", "m5ad.2xlarge", "m5ad.4xlarge",
"m5ad.8xlarge", "m5ad.12xlarge", "m5ad.16xlarge", "m5ad.24xlarge",
"m4.large", "m4.xlarge", "m4.2xlarge", "m4.4xlarge",
"m4.10xlarge", "m4.16xlarge",
"c5.large", "c5.xlarge", "c5.2xlarge", "c5.4xlarge",
"c5.9xlarge", "c5.12xlarge", "c5.18xlarge", "c5.24xlarge",
"c5d.large", "c5d.xlarge", "c5d.2xlarge", "c5d.4xlarge",
"c5d.9xlarge", "c5d.12xlarge", "c5d.18xlarge", "c5d.24xlarge",
"c5a.large", "c5a.xlarge", "c5a.2xlarge", "c5a.4xlarge",
"c5a.9xlarge", "c5a.12xlarge", "c5a.18xlarge", "c5a.24xlarge",
"c5ad.large", "c5ad.xlarge", "c5ad.2xlarge", "c5ad.4xlarge",
"c5ad.9xlarge", "c5ad.12xlarge", "c5ad.18xlarge", "c5ad.24xlarge",
"r5.large", "r5.xlarge", "r5.2xlarge", "r5.4xlarge",
"r5.8xlarge", "r5.12x.arge", "r5.16xlarge", "r5.24xlarge",
"r5d.large", "r5d.xlarge", "r5d.2xlarge", "r5d.4xlarge",
"r5d.8xlarge", "r5d.12x.arge", "r5d.16xlarge", "r5d.24xlarge",
"r5a.large", "r5a.xlarge", "r5a.2xlarge", "r5a.4xlarge",
"r5a.8xlarge", "r5a.12x.arge", "r5a.16xlarge", "r5a.24xlarge",
"r5ad.large", "r5ad.xlarge", "r5ad.2xlarge", "r5ad.4xlarge",
"r5ad.8xlarge", "r5ad.12x.arge", "r5ad.16xlarge", "r5ad.24xlarge",
"g3.4xlarge", "g3.8xlarge", "g3.16xlarge",
"x1e.xlarge", "x1e.2xlarge", "x1e.4xlarge", "x1e.8xlarge",
"x1e.16xlarge", "x1e.32xlarge",
"x1.16xlarge", "x1.32xlarge",
"z1d.large", "z1d.xlarge", "z1d.2xlarge", "z1d.3xlarge",
"z1d.6xlarge", "z1d.12xlarge",
"u-6tb1.56xlarge", "u-6tb1.112xlarge",
"u-9tb1.112xlarge", "u-12tb1.112xlarge"
],
"ConstraintDescription": "must be a valid EC2 instance type."
},
"LatestAmiId": {
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
}
},
"Resources": {
"EC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": {
"Ref": "InstanceType"
},
"SecurityGroups": [
{
"Ref": "InstanceSecurityGroup"
}
],
"KeyName": {
"Ref": "KeyName"
},
"ImageId": {
"Ref": "LatestAmiId"
},
"Tags": [
{
"Key": "Name",
"Value": "xgtdev"
}
],
"UserData": {
"Fn::Base64": {
"Fn::Sub": "#!/bin/bash\nyum update -y\n#yum install docker -y\namazon-linux-extras install docker\nsystemctl enable docker\nsystemctl start docker\nusermod -aG docker ec2-user\ndocker pull trovares/xgt\npython3 -m pip install xgt\nsu -lc \"mkdir -p data xgtlog\" ec2-user\nsu -lc \"chmod 777 data xgtlog\" ec2-user\n#su -lc \"docker run -d -p 4367:4367 -v $PWD/data:/data -v $PWD/xgtlog:/var/log/xgtd --name xgt trovares/xgt\" ec2-user\nsu -lc \"docker run -d -p 4367:4367 --name xgt trovares/xgt\" ec2-user\n"
}
}
}
},
"InstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Open xGT port 4367",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": 4367,
"ToPort": 4367,
"CidrIp": "0.0.0.0/0"
}
]
}
}
},
"Outputs": {
"InstanceId": {
"Description": "Id of the newly created AWS EC2 instance",
"Value": {
"Ref": "EC2Instance"
}
},
"AZ": {
"Description": "AZ of the newly created AWS EC2 instance",
"Value": {
"Fn::GetAtt": [
"EC2Instance",
"AvailabilityZone"
]
}
},
"PublicDNS": {
"Description": "Public DNS Name of the newly created AWS EC2 instance",
"Value": {
"Fn::GetAtt": [
"EC2Instance",
"PublicDnsName"
]
}
},
"PublicIP": {
"Description": "Public IP address of the newly created AWS EC2 instance",
"Value": {
"Fn::GetAtt": [
"EC2Instance",
"PublicIp"
]
}
}
}
}