-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall-xl-jetpack-aws.yaml
234 lines (233 loc) · 7.53 KB
/
install-xl-jetpack-aws.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
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
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
This template will setup XebiaLabs JetPack in an existing VPC with an existing database.
Metadata:
'AWS::CloudFormation::Interface':
ParameterGroups:
- Label:
default: Network Configuration
Parameters:
- VPCID
- RemoteAccessCIDR
- PrivateSubnetIDs
- PublicSubnetIDs
- Label:
default: RDS Configuration
Parameters:
- RDSSecurityGroup
- DBHost
- DBPort
- DBUsername
- DBPassword
- Label:
default: HTTP Configuration
Parameters:
- SslCertificateArn
- Label:
default: General Settings
Parameters:
- KeyPairName
- MountPoint
- Label:
default: XebiaLabs JetPack Configuration
Parameters:
- Fulfilment
- XLJetPackInstanceType
- XLJetPackVersion
- XLJetPackDeployPassword
- XLJetPackReleasePassword
ParameterLabels:
VPCID:
default: VPC ID
PublicSubnetIDs:
default: Public subnets
PrivateSubnetIDs:
default: Private subnets
XLJetPackInstanceType:
default: XL JetPack instance type
KeyPairName:
default: Key name
MountPoint:
default: EFS MountPoint
Fulfilment:
default: AWS Marketplace fulfilment
XLJetPackVersion:
default: XL JetPack version
XLJetPackDeployPassword:
default: XL JetPack Deploy administrator password
XLJetPackReleasePassword:
default: XL JetPack Release administrator password
RemoteAccessCIDR:
default: Remote access CIDR
RDSSecurityGroup:
default: RDS Security Group
DBHost:
default: Database hostname
DBPort:
default: Database port
DBUsername:
default: Database administrator username
DBPassword:
default: Database administrator password
SslCertificateArn:
default: SSL certificate arn
Parameters:
VPCID:
Description: The VPC Id
Type: AWS::EC2::VPC::Id
PublicSubnetIDs:
Description: The public subnet XL JetPack should reachable on
Type: List<AWS::EC2::Subnet::Id>
PrivateSubnetIDs:
Description: The private subnet XL JetPack should be deployed to
Type: List<AWS::EC2::Subnet::Id>
Fulfilment:
Description: The AWS Marketplace fulfilment chosen
Type: String
AllowedValues:
- 'XL-JetPack-10users'
XLJetPackInstanceType:
AllowedValues:
- m5.large
- m5.xlarge
Description: The instance type the XL DevOps Platform applications are created on
Type: String
Default: m5.xlarge
XLJetPackVersion:
Description: The version of XL JetPack to deploy
AllowedValues: ['8.6.1']
Type: String
XLJetPackDeployPassword:
Description: The admin password of XL JetPack Deploy
MinLength: 8
Type: String
NoEcho: True
XLJetPackReleasePassword:
Description: The admin password of XL JetPack Release
MinLength: 8
Type: String
NoEcho: True
RemoteAccessCIDR:
Description: CIDR block for remote access
Type: String
AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})
ConstraintDescription: CIDR block parxameter must be in the form x.x.x.x/16-28
RDSSecurityGroup:
Type: 'AWS::EC2::SecurityGroup::Id'
Description: The Security Group that grants access to the RDS database.
DBHost:
Description: The Postgres DB Host/Endpoint
Type: String
DBPort:
Description: The Postgres DB Port
Type: String
Default: 5432
DBUsername:
Description: The Postgres DB username
Type: String
DBPassword:
Description: The Postgres DB Password
Type: String
NoEcho: True
MountPoint:
Description: The Linux mount point for the EFS volume
Type: String
MinLength: '1'
Default: /mnt/efs
SslCertificateArn:
Description: The ARN of the SSL certificate used to secure internet access to the XebiaLabs JetPack instances
Type: String
Default: ':default'
KeyPairName:
Description: The name of an existing public/private key pair, which allows you to securely connect to your instance after it launches
Type: AWS::EC2::KeyPair::KeyName
Conditions:
SslCertificateProvided: !Not [ !Equals [ !Ref SslCertificateArn, ':default' ] ]
Resources:
SecurityGroupsStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/xl-jetpack-aws/infrastructure/securitygroups.yaml
Parameters:
EnvironmentName: xl-jetpack-aws
VPCID: !Ref VPCID
RDSSecurityGroup: !Ref RDSSecurityGroup
EFSStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/xl-jetpack-aws/infrastructure/efs.yaml
Parameters:
EnvironmentName: xl-jetpack-aws
VPCID: !Ref VPCID
ECSSecurityGroup: !GetAtt SecurityGroupsStack.Outputs.ECSHostSecurityGroup
Subnets: !Join [ ",", !Ref PrivateSubnetIDs ]
ECSStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/xl-jetpack-aws/infrastructure/ecs.yaml
Parameters:
VPC: !Ref VPCID
EnvironmentName: xl-jetpack-aws
Subnets: !Join [ ",", !Ref PrivateSubnetIDs ]
InstanceType: !Ref XLJetPackInstanceType
DesiredClusterSize: 2
MinimumClusterSize: 2
MaximumClusterSize: 2
ECSSecurityGroup: !GetAtt SecurityGroupsStack.Outputs.ECSHostSecurityGroup
KeyPairName: !Ref KeyPairName
MountPoint: !Ref MountPoint
Filesystem: !GetAtt EFSStack.Outputs.Filesystem
LoadBalancerStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://s3.amazonaws.com/xl-jetpack-aws/infrastructure/alb.yaml
Parameters:
EnvironmentName: xl-jetpack-aws
VPCID: !Ref VPCID
Subnets: !Join [ ",", !Ref PublicSubnetIDs ]
SecurityGroup: !GetAtt SecurityGroupsStack.Outputs.LoadBalancerSecurityGroup
XLJetPackServices:
Type: 'AWS::CloudFormation::Stack'
Properties:
TemplateURL: https://s3.amazonaws.com/xl-jetpack-aws/services/xl-jetpack.yaml
Parameters:
VPCID: !Ref VPCID
ECSCluster: !GetAtt ECSStack.Outputs.Cluster
ECSServiceRole: !GetAtt ECSStack.Outputs.ECSServiceRole
Fulfilment: !Ref Fulfilment
XLJetPackVersion: !Ref XLJetPackVersion
XLJetPackDeployAdminPassword: !Ref XLJetPackDeployPassword
XLJetPackReleaseAdminPassword: !Ref XLJetPackReleasePassword
LoadBalancer: !GetAtt LoadBalancerStack.Outputs.LoadBalancer
ALBSecurityGroup: !GetAtt SecurityGroupsStack.Outputs.LoadBalancerSecurityGroup
RemoteAccessCIDR: !Ref RemoteAccessCIDR
TaskExecutionRole: !GetAtt ECSStack.Outputs.ECSTaskExecutionRole
DBHost: !Ref DBHost
DBPort: !Ref DBPort
DBUser: !Ref DBUsername
DBPassword: !Ref DBPassword
SslCertificateArn: !Ref SslCertificateArn
Outputs:
JetPackDeployURL:
Description: The URL where XL JetPack Deploy is reachable
Value: !Join
- ''
- - !If
- SslCertificateProvided
- https
- http
- '://'
- !GetAtt LoadBalancerStack.Outputs.LoadBalancerUrl
- ':4516/'
XLJetPackReleaseURL:
Description: The URL where XL JetPack Release is reachable
Value: !Join
- ''
- - !If
- SslCertificateProvided
- https
- http
- '://'
- !GetAtt LoadBalancerStack.Outputs.LoadBalancerUrl
- ':5516/'