-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yaml
105 lines (87 loc) · 3.08 KB
/
deploy.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Parameters:
KeyPairName:
Type: String
Resources:
ApplicationSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow traffic from everywhere
SecurityGroupIngress:
IpProtocol: -1
CidrIp: 0.0.0.0/0
TykEnvironment:
Type: AWS::EC2::Instance
Properties:
UserData:
Fn::Base64: !Sub |
#!/bin/bash -xe
# PREWORK:
sudo yum update -y
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
sudo yum install python34 -y
sudo yum install pygpgme yum-utils wget -y
# REDIS:
sudo yum install -y redis
sudo service redis start
# MONGO:
sudo cat > /etc/yum.repos.d/mongodb-org-4.4.repo <<EOF
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
EOF
sudo yum install mongodb-org -y
sudo service mongod start
# GATEWAY: (yum install tyk-dashboard-3.0.1-1.x86_64 -y)
sudo cat > /etc/yum.repos.d/tyk_tyk-gateway.repo <<EOF
[tyk_tyk-gateway]
name=tyk_tyk-gateway
baseurl=https://packagecloud.io/tyk/tyk-gateway/el/7/\$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://keyserver.tyk.io/tyk.io.rpm.signing.key.2020
https://packagecloud.io/tyk/tyk-gateway/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOF
sudo yum -q makecache -y --disablerepo='*' --enablerepo='tyk_tyk-gateway' --enablerepo=epel
sudo yum install tyk-gateway -y
sudo /opt/tyk-gateway/install/setup.sh \
--listenport=8080 \
--redishost=localhost \
--redisport=6379 \
--domain="0.0.0.0"
sudo service tyk-gateway start
# PUMP:
sudo cat > /etc/yum.repos.d/tyk_tyk-pump.repo <<EOF
[tyk_tyk-pump]
name=tyk_tyk-pump
baseurl=https://packagecloud.io/tyk/tyk-pump/el/7/\$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://keyserver.tyk.io/tyk.io.rpm.signing.key.2020
https://packagecloud.io/tyk/tyk-pump/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOF
sudo yum -q makecache -y --disablerepo='*' --enablerepo='tyk_tyk-pump'
sudo yum install tyk-pump -y
sudo /opt/tyk-pump/install/setup.sh \
--redishost=localhost \
--redisport=6379 \
--mongo=mongodb://localhost/tyk_analytics
sudo service tyk-pump start
ImageId: ami-0ba0ce0c11eb723a1
InstanceType: t2.micro
SecurityGroupIds:
- !Ref ApplicationSG
KeyName: !Ref KeyPairName
Tags:
- Key: "Name"
Value: TYK_OSS