cdk-gitlab-runner 2.2.256 → 2.2.258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/API.md +611 -147
- package/lib/gitlab-runner-autoscaling.js +1 -1
- package/lib/gitlab-runner-instance.js +1 -1
- package/package.json +6 -6
package/API.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# API Reference <a name="API Reference"></a>
|
|
1
|
+
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
2
2
|
|
|
3
|
-
## Constructs <a name="Constructs"></a>
|
|
3
|
+
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
4
4
|
|
|
5
|
-
### GitlabContainerRunner <a name="cdk-gitlab-runner.GitlabContainerRunner"></a>
|
|
5
|
+
### GitlabContainerRunner <a name="GitlabContainerRunner" id="cdk-gitlab-runner.GitlabContainerRunner"></a>
|
|
6
6
|
|
|
7
7
|
GitlabContainerRunner Construct for create a Gitlab Runner.
|
|
8
8
|
|
|
9
|
-
#### Initializers <a name="cdk-gitlab-runner.GitlabContainerRunner.Initializer"></a>
|
|
9
|
+
#### Initializers <a name="Initializers" id="cdk-gitlab-runner.GitlabContainerRunner.Initializer"></a>
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
import { GitlabContainerRunner } from 'cdk-gitlab-runner'
|
|
@@ -14,141 +14,216 @@ import { GitlabContainerRunner } from 'cdk-gitlab-runner'
|
|
|
14
14
|
new GitlabContainerRunner(scope: Construct, id: string, props: GitlabContainerRunnerProps)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
| **Name** | **Type** | **Description** |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
20
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
21
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps">GitlabContainerRunnerProps</a></code> | *No description.* |
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.scope"></a>
|
|
26
|
+
|
|
27
|
+
- *Type:* constructs.Construct
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
##### `id`<sup>Required</sup> <a name="id" id="cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.id"></a>
|
|
32
|
+
|
|
33
|
+
- *Type:* string
|
|
20
34
|
|
|
21
35
|
---
|
|
22
36
|
|
|
23
|
-
##### `
|
|
37
|
+
##### `props`<sup>Required</sup> <a name="props" id="cdk-gitlab-runner.GitlabContainerRunner.Initializer.parameter.props"></a>
|
|
24
38
|
|
|
25
|
-
- *Type:*
|
|
39
|
+
- *Type:* <a href="#cdk-gitlab-runner.GitlabContainerRunnerProps">GitlabContainerRunnerProps</a>
|
|
26
40
|
|
|
27
41
|
---
|
|
28
42
|
|
|
29
|
-
|
|
43
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
| **Name** | **Description** |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
48
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.createUserData">createUserData</a></code> | *No description.* |
|
|
49
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.expireAfter">expireAfter</a></code> | Add expire time function for spotfleet runner !!! . |
|
|
32
50
|
|
|
33
51
|
---
|
|
34
52
|
|
|
35
|
-
|
|
53
|
+
##### `toString` <a name="toString" id="cdk-gitlab-runner.GitlabContainerRunner.toString"></a>
|
|
36
54
|
|
|
37
|
-
|
|
55
|
+
```typescript
|
|
56
|
+
public toString(): string
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Returns a string representation of this construct.
|
|
60
|
+
|
|
61
|
+
##### `createUserData` <a name="createUserData" id="cdk-gitlab-runner.GitlabContainerRunner.createUserData"></a>
|
|
38
62
|
|
|
39
63
|
```typescript
|
|
40
|
-
public createUserData(props: GitlabContainerRunnerProps, tokenParameterStoreName: string)
|
|
64
|
+
public createUserData(props: GitlabContainerRunnerProps, tokenParameterStoreName: string): string[]
|
|
41
65
|
```
|
|
42
66
|
|
|
43
|
-
###### `props`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.parameter.props"></a>
|
|
67
|
+
###### `props`<sup>Required</sup> <a name="props" id="cdk-gitlab-runner.GitlabContainerRunner.createUserData.parameter.props"></a>
|
|
44
68
|
|
|
45
|
-
- *Type:*
|
|
69
|
+
- *Type:* <a href="#cdk-gitlab-runner.GitlabContainerRunnerProps">GitlabContainerRunnerProps</a>
|
|
46
70
|
|
|
47
71
|
---
|
|
48
72
|
|
|
49
|
-
###### `tokenParameterStoreName`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.parameter.tokenParameterStoreName"></a>
|
|
73
|
+
###### `tokenParameterStoreName`<sup>Required</sup> <a name="tokenParameterStoreName" id="cdk-gitlab-runner.GitlabContainerRunner.createUserData.parameter.tokenParameterStoreName"></a>
|
|
50
74
|
|
|
51
|
-
- *Type:*
|
|
75
|
+
- *Type:* string
|
|
52
76
|
|
|
53
77
|
the tokenParameterStoreName to put gitlab runner token.
|
|
54
78
|
|
|
55
79
|
---
|
|
56
80
|
|
|
57
|
-
##### `expireAfter` <a name="cdk-gitlab-runner.GitlabContainerRunner.expireAfter"></a>
|
|
81
|
+
##### `expireAfter` <a name="expireAfter" id="cdk-gitlab-runner.GitlabContainerRunner.expireAfter"></a>
|
|
58
82
|
|
|
59
83
|
```typescript
|
|
60
|
-
public expireAfter(duration: Duration)
|
|
84
|
+
public expireAfter(duration: Duration): void
|
|
61
85
|
```
|
|
62
86
|
|
|
63
|
-
|
|
87
|
+
Add expire time function for spotfleet runner !!! .
|
|
64
88
|
|
|
65
|
-
|
|
89
|
+
###### `duration`<sup>Required</sup> <a name="duration" id="cdk-gitlab-runner.GitlabContainerRunner.expireAfter.parameter.duration"></a>
|
|
90
|
+
|
|
91
|
+
- *Type:* aws-cdk-lib.Duration
|
|
66
92
|
|
|
67
93
|
Block duration.
|
|
68
94
|
|
|
69
95
|
---
|
|
70
96
|
|
|
97
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
98
|
+
|
|
99
|
+
| **Name** | **Description** |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk-gitlab-runner.GitlabContainerRunner.isConstruct"></a>
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { GitlabContainerRunner } from 'cdk-gitlab-runner'
|
|
109
|
+
|
|
110
|
+
GitlabContainerRunner.isConstruct(x: any)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Checks if `x` is a construct.
|
|
114
|
+
|
|
115
|
+
###### `x`<sup>Required</sup> <a name="x" id="cdk-gitlab-runner.GitlabContainerRunner.isConstruct.parameter.x"></a>
|
|
116
|
+
|
|
117
|
+
- *Type:* any
|
|
118
|
+
|
|
119
|
+
Any object.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
71
124
|
|
|
72
|
-
|
|
125
|
+
| **Name** | **Type** | **Description** |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
128
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.defaultRunnerSG">defaultRunnerSG</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | The EC2 runner's default SecurityGroup. |
|
|
129
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.runnerEc2">runnerEc2</a></code> | <code>aws-cdk-lib.aws_ec2.IInstance</code> | This represents a Runner EC2 instance , !!! only support On-demand runner instance !!! |
|
|
130
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.runnerRole">runnerRole</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | The IAM role assumed by the Runner instance . |
|
|
131
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetInstanceId">spotFleetInstanceId</a></code> | <code>string</code> | the first instance id in this fleet , !!! only support spotfleet runner !!! |
|
|
132
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetRequestId">spotFleetRequestId</a></code> | <code>string</code> | SpotFleetRequestId for this spot fleet , !!! only support spotfleet runner !!! |
|
|
133
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | The EC2 runner's vpc. |
|
|
73
134
|
|
|
74
|
-
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
##### `node`<sup>Required</sup> <a name="node" id="cdk-gitlab-runner.GitlabContainerRunner.property.node"></a>
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
public readonly node: Node;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- *Type:* constructs.Node
|
|
144
|
+
|
|
145
|
+
The tree node.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
##### `defaultRunnerSG`<sup>Required</sup> <a name="defaultRunnerSG" id="cdk-gitlab-runner.GitlabContainerRunner.property.defaultRunnerSG"></a>
|
|
75
150
|
|
|
76
151
|
```typescript
|
|
77
152
|
public readonly defaultRunnerSG: ISecurityGroup;
|
|
78
153
|
```
|
|
79
154
|
|
|
80
|
-
- *Type:*
|
|
155
|
+
- *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
|
|
81
156
|
|
|
82
157
|
The EC2 runner's default SecurityGroup.
|
|
83
158
|
|
|
84
159
|
---
|
|
85
160
|
|
|
86
|
-
##### `runnerEc2`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.property.runnerEc2"></a>
|
|
161
|
+
##### `runnerEc2`<sup>Required</sup> <a name="runnerEc2" id="cdk-gitlab-runner.GitlabContainerRunner.property.runnerEc2"></a>
|
|
87
162
|
|
|
88
163
|
```typescript
|
|
89
164
|
public readonly runnerEc2: IInstance;
|
|
90
165
|
```
|
|
91
166
|
|
|
92
|
-
- *Type:*
|
|
167
|
+
- *Type:* aws-cdk-lib.aws_ec2.IInstance
|
|
93
168
|
|
|
94
169
|
This represents a Runner EC2 instance , !!! only support On-demand runner instance !!!
|
|
95
170
|
|
|
96
171
|
---
|
|
97
172
|
|
|
98
|
-
##### `runnerRole`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.property.runnerRole"></a>
|
|
173
|
+
##### `runnerRole`<sup>Required</sup> <a name="runnerRole" id="cdk-gitlab-runner.GitlabContainerRunner.property.runnerRole"></a>
|
|
99
174
|
|
|
100
175
|
```typescript
|
|
101
176
|
public readonly runnerRole: IRole;
|
|
102
177
|
```
|
|
103
178
|
|
|
104
|
-
- *Type:*
|
|
179
|
+
- *Type:* aws-cdk-lib.aws_iam.IRole
|
|
105
180
|
|
|
106
181
|
The IAM role assumed by the Runner instance .
|
|
107
182
|
|
|
108
183
|
---
|
|
109
184
|
|
|
110
|
-
##### `spotFleetInstanceId`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetInstanceId"></a>
|
|
185
|
+
##### `spotFleetInstanceId`<sup>Required</sup> <a name="spotFleetInstanceId" id="cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetInstanceId"></a>
|
|
111
186
|
|
|
112
187
|
```typescript
|
|
113
188
|
public readonly spotFleetInstanceId: string;
|
|
114
189
|
```
|
|
115
190
|
|
|
116
|
-
- *Type:*
|
|
191
|
+
- *Type:* string
|
|
117
192
|
|
|
118
193
|
the first instance id in this fleet , !!! only support spotfleet runner !!!
|
|
119
194
|
|
|
120
195
|
---
|
|
121
196
|
|
|
122
|
-
##### `spotFleetRequestId`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetRequestId"></a>
|
|
197
|
+
##### `spotFleetRequestId`<sup>Required</sup> <a name="spotFleetRequestId" id="cdk-gitlab-runner.GitlabContainerRunner.property.spotFleetRequestId"></a>
|
|
123
198
|
|
|
124
199
|
```typescript
|
|
125
200
|
public readonly spotFleetRequestId: string;
|
|
126
201
|
```
|
|
127
202
|
|
|
128
|
-
- *Type:*
|
|
203
|
+
- *Type:* string
|
|
129
204
|
|
|
130
205
|
SpotFleetRequestId for this spot fleet , !!! only support spotfleet runner !!!
|
|
131
206
|
|
|
132
207
|
---
|
|
133
208
|
|
|
134
|
-
##### `vpc`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunner.property.vpc"></a>
|
|
209
|
+
##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-gitlab-runner.GitlabContainerRunner.property.vpc"></a>
|
|
135
210
|
|
|
136
211
|
```typescript
|
|
137
212
|
public readonly vpc: IVpc;
|
|
138
213
|
```
|
|
139
214
|
|
|
140
|
-
- *Type:*
|
|
215
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
141
216
|
|
|
142
217
|
The EC2 runner's vpc.
|
|
143
218
|
|
|
144
219
|
---
|
|
145
220
|
|
|
146
221
|
|
|
147
|
-
### GitlabRunnerAutoscaling <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling"></a>
|
|
222
|
+
### GitlabRunnerAutoscaling <a name="GitlabRunnerAutoscaling" id="cdk-gitlab-runner.GitlabRunnerAutoscaling"></a>
|
|
148
223
|
|
|
149
224
|
GitlabRunnerAutoscaling Construct for create Autoscaling Gitlab Runner.
|
|
150
225
|
|
|
151
|
-
#### Initializers <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer"></a>
|
|
226
|
+
#### Initializers <a name="Initializers" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer"></a>
|
|
152
227
|
|
|
153
228
|
```typescript
|
|
154
229
|
import { GitlabRunnerAutoscaling } from 'cdk-gitlab-runner'
|
|
@@ -156,109 +231,180 @@ import { GitlabRunnerAutoscaling } from 'cdk-gitlab-runner'
|
|
|
156
231
|
new GitlabRunnerAutoscaling(scope: Construct, id: string, props: GitlabRunnerAutoscalingProps)
|
|
157
232
|
```
|
|
158
233
|
|
|
159
|
-
|
|
234
|
+
| **Name** | **Type** | **Description** |
|
|
235
|
+
| --- | --- | --- |
|
|
236
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
237
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
238
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.props">props</a></code> | <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps">GitlabRunnerAutoscalingProps</a></code> | *No description.* |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.scope"></a>
|
|
243
|
+
|
|
244
|
+
- *Type:* constructs.Construct
|
|
160
245
|
|
|
161
|
-
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
##### `id`<sup>Required</sup> <a name="id" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.id"></a>
|
|
249
|
+
|
|
250
|
+
- *Type:* string
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
##### `props`<sup>Required</sup> <a name="props" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.Initializer.parameter.props"></a>
|
|
255
|
+
|
|
256
|
+
- *Type:* <a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps">GitlabRunnerAutoscalingProps</a>
|
|
162
257
|
|
|
163
258
|
---
|
|
164
259
|
|
|
165
|
-
|
|
260
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
166
261
|
|
|
167
|
-
|
|
262
|
+
| **Name** | **Description** |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
265
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.createUserData">createUserData</a></code> | *No description.* |
|
|
168
266
|
|
|
169
267
|
---
|
|
170
268
|
|
|
171
|
-
##### `
|
|
269
|
+
##### `toString` <a name="toString" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.toString"></a>
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
public toString(): string
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Returns a string representation of this construct.
|
|
276
|
+
|
|
277
|
+
##### `createUserData` <a name="createUserData" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.createUserData"></a>
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
public createUserData(props: GitlabRunnerAutoscalingProps): string[]
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
###### `props`<sup>Required</sup> <a name="props" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.createUserData.parameter.props"></a>
|
|
172
284
|
|
|
173
|
-
- *Type:*
|
|
285
|
+
- *Type:* <a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps">GitlabRunnerAutoscalingProps</a>
|
|
174
286
|
|
|
175
287
|
---
|
|
176
288
|
|
|
177
|
-
####
|
|
289
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
178
290
|
|
|
179
|
-
|
|
291
|
+
| **Name** | **Description** |
|
|
292
|
+
| --- | --- |
|
|
293
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.isConstruct"></a>
|
|
180
298
|
|
|
181
299
|
```typescript
|
|
182
|
-
|
|
300
|
+
import { GitlabRunnerAutoscaling } from 'cdk-gitlab-runner'
|
|
301
|
+
|
|
302
|
+
GitlabRunnerAutoscaling.isConstruct(x: any)
|
|
183
303
|
```
|
|
184
304
|
|
|
185
|
-
|
|
305
|
+
Checks if `x` is a construct.
|
|
186
306
|
|
|
187
|
-
|
|
307
|
+
###### `x`<sup>Required</sup> <a name="x" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.isConstruct.parameter.x"></a>
|
|
308
|
+
|
|
309
|
+
- *Type:* any
|
|
310
|
+
|
|
311
|
+
Any object.
|
|
188
312
|
|
|
189
313
|
---
|
|
190
314
|
|
|
315
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
316
|
+
|
|
317
|
+
| **Name** | **Type** | **Description** |
|
|
318
|
+
| --- | --- | --- |
|
|
319
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
320
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.autoscalingGroup">autoscalingGroup</a></code> | <code>aws-cdk-lib.aws_autoscaling.AutoScalingGroup</code> | This represents a Runner Auto Scaling Group. |
|
|
321
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.instanceRole">instanceRole</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | The IAM role assumed by the Runner instance. |
|
|
322
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | The EC2 runner's default SecurityGroup. |
|
|
323
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.topicAlarm">topicAlarm</a></code> | <code>aws-cdk-lib.aws_sns.ITopic</code> | The SNS topic to suscribe alarms for EC2 runner's metrics. |
|
|
324
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscaling.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | The EC2 runner's VPC. |
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
##### `node`<sup>Required</sup> <a name="node" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.node"></a>
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
public readonly node: Node;
|
|
332
|
+
```
|
|
191
333
|
|
|
192
|
-
|
|
334
|
+
- *Type:* constructs.Node
|
|
193
335
|
|
|
194
|
-
|
|
336
|
+
The tree node.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
##### `autoscalingGroup`<sup>Required</sup> <a name="autoscalingGroup" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.autoscalingGroup"></a>
|
|
195
341
|
|
|
196
342
|
```typescript
|
|
197
343
|
public readonly autoscalingGroup: AutoScalingGroup;
|
|
198
344
|
```
|
|
199
345
|
|
|
200
|
-
- *Type:*
|
|
346
|
+
- *Type:* aws-cdk-lib.aws_autoscaling.AutoScalingGroup
|
|
201
347
|
|
|
202
348
|
This represents a Runner Auto Scaling Group.
|
|
203
349
|
|
|
204
350
|
---
|
|
205
351
|
|
|
206
|
-
##### `instanceRole`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.instanceRole"></a>
|
|
352
|
+
##### `instanceRole`<sup>Required</sup> <a name="instanceRole" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.instanceRole"></a>
|
|
207
353
|
|
|
208
354
|
```typescript
|
|
209
355
|
public readonly instanceRole: IRole;
|
|
210
356
|
```
|
|
211
357
|
|
|
212
|
-
- *Type:*
|
|
358
|
+
- *Type:* aws-cdk-lib.aws_iam.IRole
|
|
213
359
|
|
|
214
360
|
The IAM role assumed by the Runner instance.
|
|
215
361
|
|
|
216
362
|
---
|
|
217
363
|
|
|
218
|
-
##### `securityGroup`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.securityGroup"></a>
|
|
364
|
+
##### `securityGroup`<sup>Required</sup> <a name="securityGroup" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.securityGroup"></a>
|
|
219
365
|
|
|
220
366
|
```typescript
|
|
221
367
|
public readonly securityGroup: ISecurityGroup;
|
|
222
368
|
```
|
|
223
369
|
|
|
224
|
-
- *Type:*
|
|
370
|
+
- *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
|
|
225
371
|
|
|
226
372
|
The EC2 runner's default SecurityGroup.
|
|
227
373
|
|
|
228
374
|
---
|
|
229
375
|
|
|
230
|
-
##### `topicAlarm`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.topicAlarm"></a>
|
|
376
|
+
##### `topicAlarm`<sup>Required</sup> <a name="topicAlarm" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.topicAlarm"></a>
|
|
231
377
|
|
|
232
378
|
```typescript
|
|
233
379
|
public readonly topicAlarm: ITopic;
|
|
234
380
|
```
|
|
235
381
|
|
|
236
|
-
- *Type:*
|
|
382
|
+
- *Type:* aws-cdk-lib.aws_sns.ITopic
|
|
237
383
|
|
|
238
384
|
The SNS topic to suscribe alarms for EC2 runner's metrics.
|
|
239
385
|
|
|
240
386
|
---
|
|
241
387
|
|
|
242
|
-
##### `vpc`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.vpc"></a>
|
|
388
|
+
##### `vpc`<sup>Required</sup> <a name="vpc" id="cdk-gitlab-runner.GitlabRunnerAutoscaling.property.vpc"></a>
|
|
243
389
|
|
|
244
390
|
```typescript
|
|
245
391
|
public readonly vpc: IVpc;
|
|
246
392
|
```
|
|
247
393
|
|
|
248
|
-
- *Type:*
|
|
394
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
249
395
|
|
|
250
396
|
The EC2 runner's VPC.
|
|
251
397
|
|
|
252
398
|
---
|
|
253
399
|
|
|
254
400
|
|
|
255
|
-
## Structs <a name="Structs"></a>
|
|
401
|
+
## Structs <a name="Structs" id="Structs"></a>
|
|
256
402
|
|
|
257
|
-
### DockerVolumes <a name="cdk-gitlab-runner.DockerVolumes"></a>
|
|
403
|
+
### DockerVolumes <a name="DockerVolumes" id="cdk-gitlab-runner.DockerVolumes"></a>
|
|
258
404
|
|
|
259
405
|
Docker Volumes interface.
|
|
260
406
|
|
|
261
|
-
#### Initializer <a name="
|
|
407
|
+
#### Initializer <a name="Initializer" id="cdk-gitlab-runner.DockerVolumes.Initializer"></a>
|
|
262
408
|
|
|
263
409
|
```typescript
|
|
264
410
|
import { DockerVolumes } from 'cdk-gitlab-runner'
|
|
@@ -266,35 +412,60 @@ import { DockerVolumes } from 'cdk-gitlab-runner'
|
|
|
266
412
|
const dockerVolumes: DockerVolumes = { ... }
|
|
267
413
|
```
|
|
268
414
|
|
|
269
|
-
|
|
415
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
416
|
+
|
|
417
|
+
| **Name** | **Type** | **Description** |
|
|
418
|
+
| --- | --- | --- |
|
|
419
|
+
| <code><a href="#cdk-gitlab-runner.DockerVolumes.property.containerPath">containerPath</a></code> | <code>string</code> | Job Runtime Container Path Host Path. |
|
|
420
|
+
| <code><a href="#cdk-gitlab-runner.DockerVolumes.property.hostPath">hostPath</a></code> | <code>string</code> | EC2 Runner Host Path. |
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
##### `containerPath`<sup>Required</sup> <a name="containerPath" id="cdk-gitlab-runner.DockerVolumes.property.containerPath"></a>
|
|
270
425
|
|
|
271
426
|
```typescript
|
|
272
427
|
public readonly containerPath: string;
|
|
273
428
|
```
|
|
274
429
|
|
|
275
|
-
- *Type:*
|
|
430
|
+
- *Type:* string
|
|
276
431
|
|
|
277
432
|
Job Runtime Container Path Host Path.
|
|
278
433
|
|
|
279
434
|
---
|
|
280
435
|
|
|
281
|
-
|
|
436
|
+
*Example*
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
- /tmp/cahce
|
|
440
|
+
more detail see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersdocker-section
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
##### `hostPath`<sup>Required</sup> <a name="hostPath" id="cdk-gitlab-runner.DockerVolumes.property.hostPath"></a>
|
|
282
445
|
|
|
283
446
|
```typescript
|
|
284
447
|
public readonly hostPath: string;
|
|
285
448
|
```
|
|
286
449
|
|
|
287
|
-
- *Type:*
|
|
450
|
+
- *Type:* string
|
|
288
451
|
|
|
289
452
|
EC2 Runner Host Path.
|
|
290
453
|
|
|
291
454
|
---
|
|
292
455
|
|
|
293
|
-
|
|
456
|
+
*Example*
|
|
457
|
+
|
|
458
|
+
```typescript
|
|
459
|
+
- /tmp/cahce
|
|
460
|
+
more detail see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersdocker-section
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
### GitlabContainerRunnerProps <a name="GitlabContainerRunnerProps" id="cdk-gitlab-runner.GitlabContainerRunnerProps"></a>
|
|
294
465
|
|
|
295
466
|
GitlabContainerRunner Props.
|
|
296
467
|
|
|
297
|
-
#### Initializer <a name="
|
|
468
|
+
#### Initializer <a name="Initializer" id="cdk-gitlab-runner.GitlabContainerRunnerProps.Initializer"></a>
|
|
298
469
|
|
|
299
470
|
```typescript
|
|
300
471
|
import { GitlabContainerRunnerProps } from 'cdk-gitlab-runner'
|
|
@@ -302,51 +473,90 @@ import { GitlabContainerRunnerProps } from 'cdk-gitlab-runner'
|
|
|
302
473
|
const gitlabContainerRunnerProps: GitlabContainerRunnerProps = { ... }
|
|
303
474
|
```
|
|
304
475
|
|
|
305
|
-
|
|
476
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
477
|
+
|
|
478
|
+
| **Name** | **Type** | **Description** |
|
|
479
|
+
| --- | --- | --- |
|
|
480
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabRunnerVersion">gitlabRunnerVersion</a></code> | <code>string</code> | Gitlab Runner version Please give me gitlab runner version. |
|
|
481
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabtoken">gitlabtoken</a></code> | <code>string</code> | Gitlab token for the Register Runner . |
|
|
482
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.concurrentJobs">concurrentJobs</a></code> | <code>number</code> | Gitlab Runner concurrent job configuration. |
|
|
483
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.dockerVolumes">dockerVolumes</a></code> | <code><a href="#cdk-gitlab-runner.DockerVolumes">DockerVolumes</a>[]</code> | add another Gitlab Container Runner Docker Volumes Path at job runner runtime. |
|
|
484
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.ebsSize">ebsSize</a></code> | <code>number</code> | Gitlab Runner instance EBS size . |
|
|
485
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.ec2iamrole">ec2iamrole</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | IAM role for the Gitlab Runner Instance . |
|
|
486
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.ec2type">ec2type</a></code> | <code>string</code> | Runner default EC2 instance type. |
|
|
487
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.enabledIMDSv2">enabledIMDSv2</a></code> | <code>boolean</code> | Enabled IMDSv2. |
|
|
488
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabRunnerImage">gitlabRunnerImage</a></code> | <code>string</code> | Image URL of Gitlab Runner. |
|
|
489
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlaburl">gitlaburl</a></code> | <code>string</code> | Gitlab Runner register url . |
|
|
490
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.instanceInterruptionBehavior">instanceInterruptionBehavior</a></code> | <code><a href="#cdk-gitlab-runner.InstanceInterruptionBehavior">InstanceInterruptionBehavior</a></code> | The behavior when a Spot Runner Instance is interrupted. |
|
|
491
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.keyName">keyName</a></code> | <code>string</code> | SSH key name. |
|
|
492
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.runnerDescription">runnerDescription</a></code> | <code>string</code> | Gitlab Runner description. |
|
|
493
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.selfvpc">selfvpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC for the Gitlab Runner . |
|
|
494
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.spotFleet">spotFleet</a></code> | <code>boolean</code> | Gitlab Runner instance Use Spot Fleet or not ?!. |
|
|
495
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.tags">tags</a></code> | <code>string[]</code> | tags for the runner Unsupported Gitlab Runner 15.10 and later. |
|
|
496
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.validUntil">validUntil</a></code> | <code>string</code> | the time when the spot fleet allocation expires. |
|
|
497
|
+
| <code><a href="#cdk-gitlab-runner.GitlabContainerRunnerProps.property.vpcSubnet">vpcSubnet</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | VPC subnet for the spot fleet. |
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
##### `gitlabRunnerVersion`<sup>Required</sup> <a name="gitlabRunnerVersion" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabRunnerVersion"></a>
|
|
306
502
|
|
|
307
503
|
```typescript
|
|
308
504
|
public readonly gitlabRunnerVersion: string;
|
|
309
505
|
```
|
|
310
506
|
|
|
311
|
-
- *Type:*
|
|
507
|
+
- *Type:* string
|
|
312
508
|
|
|
313
509
|
Gitlab Runner version Please give me gitlab runner version.
|
|
314
510
|
|
|
315
511
|
---
|
|
316
512
|
|
|
317
|
-
##### `gitlabtoken`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabtoken"></a>
|
|
513
|
+
##### `gitlabtoken`<sup>Required</sup> <a name="gitlabtoken" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabtoken"></a>
|
|
318
514
|
|
|
319
515
|
```typescript
|
|
320
516
|
public readonly gitlabtoken: string;
|
|
321
517
|
```
|
|
322
518
|
|
|
323
|
-
- *Type:*
|
|
519
|
+
- *Type:* string
|
|
324
520
|
- *Default:* You must to give the token !!!
|
|
325
521
|
|
|
326
522
|
Gitlab token for the Register Runner .
|
|
327
523
|
|
|
328
524
|
---
|
|
329
525
|
|
|
330
|
-
|
|
526
|
+
*Example*
|
|
527
|
+
|
|
528
|
+
```typescript
|
|
529
|
+
new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN' });
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
##### `concurrentJobs`<sup>Optional</sup> <a name="concurrentJobs" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.concurrentJobs"></a>
|
|
331
534
|
|
|
332
535
|
```typescript
|
|
333
536
|
public readonly concurrentJobs: number;
|
|
334
537
|
```
|
|
335
538
|
|
|
336
|
-
- *Type:*
|
|
539
|
+
- *Type:* number
|
|
337
540
|
- *Default:* concurrentJobs=1
|
|
338
541
|
|
|
339
542
|
Gitlab Runner concurrent job configuration.
|
|
340
543
|
|
|
341
544
|
---
|
|
342
545
|
|
|
343
|
-
|
|
546
|
+
*Example*
|
|
547
|
+
|
|
548
|
+
```typescript
|
|
549
|
+
const runner = new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN',concurrentJobs: 3});
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
##### `dockerVolumes`<sup>Optional</sup> <a name="dockerVolumes" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.dockerVolumes"></a>
|
|
344
554
|
|
|
345
555
|
```typescript
|
|
346
556
|
public readonly dockerVolumes: DockerVolumes[];
|
|
347
557
|
```
|
|
348
558
|
|
|
349
|
-
- *Type:*
|
|
559
|
+
- *Type:* <a href="#cdk-gitlab-runner.DockerVolumes">DockerVolumes</a>[]
|
|
350
560
|
- *Default:* already mount "/var/run/docker.sock:/var/run/docker.sock"
|
|
351
561
|
|
|
352
562
|
add another Gitlab Container Runner Docker Volumes Path at job runner runtime.
|
|
@@ -355,52 +565,91 @@ more detail see https://docs.gitlab.com/runner/configuration/advanced-configurat
|
|
|
355
565
|
|
|
356
566
|
---
|
|
357
567
|
|
|
358
|
-
|
|
568
|
+
*Example*
|
|
569
|
+
|
|
570
|
+
```typescript
|
|
571
|
+
dockerVolumes: [
|
|
572
|
+
{
|
|
573
|
+
hostPath: '/tmp/cache',
|
|
574
|
+
containerPath: '/tmp/cache',
|
|
575
|
+
},
|
|
576
|
+
],
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
##### `ebsSize`<sup>Optional</sup> <a name="ebsSize" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.ebsSize"></a>
|
|
359
581
|
|
|
360
582
|
```typescript
|
|
361
583
|
public readonly ebsSize: number;
|
|
362
584
|
```
|
|
363
585
|
|
|
364
|
-
- *Type:*
|
|
586
|
+
- *Type:* number
|
|
365
587
|
- *Default:* ebsSize=60
|
|
366
588
|
|
|
367
589
|
Gitlab Runner instance EBS size .
|
|
368
590
|
|
|
369
591
|
---
|
|
370
592
|
|
|
371
|
-
|
|
593
|
+
*Example*
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
const runner = new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN',ebsSize: 100});
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
##### `ec2iamrole`<sup>Optional</sup> <a name="ec2iamrole" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.ec2iamrole"></a>
|
|
372
601
|
|
|
373
602
|
```typescript
|
|
374
603
|
public readonly ec2iamrole: IRole;
|
|
375
604
|
```
|
|
376
605
|
|
|
377
|
-
- *Type:*
|
|
606
|
+
- *Type:* aws-cdk-lib.aws_iam.IRole
|
|
378
607
|
- *Default:* new Role for Gitlab Runner Instance , attach AmazonSSMManagedInstanceCore Policy .
|
|
379
608
|
|
|
380
609
|
IAM role for the Gitlab Runner Instance .
|
|
381
610
|
|
|
382
611
|
---
|
|
383
612
|
|
|
384
|
-
|
|
613
|
+
*Example*
|
|
614
|
+
|
|
615
|
+
```typescript
|
|
616
|
+
const role = new Role(stack, 'runner-role', {
|
|
617
|
+
assumedBy: new ServicePrincipal('ec2.amazonaws.com'),
|
|
618
|
+
description: 'For Gitlab EC2 Runner Test Role',
|
|
619
|
+
roleName: 'Myself-Runner-Role',
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN', ec2iamrole: role });
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
##### `ec2type`<sup>Optional</sup> <a name="ec2type" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.ec2type"></a>
|
|
385
627
|
|
|
386
628
|
```typescript
|
|
387
629
|
public readonly ec2type: string;
|
|
388
630
|
```
|
|
389
631
|
|
|
390
|
-
- *Type:*
|
|
632
|
+
- *Type:* string
|
|
391
633
|
- *Default:* t3.micro
|
|
392
634
|
|
|
393
635
|
Runner default EC2 instance type.
|
|
394
636
|
|
|
395
637
|
---
|
|
396
638
|
|
|
397
|
-
|
|
639
|
+
*Example*
|
|
640
|
+
|
|
641
|
+
```typescript
|
|
642
|
+
new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN', ec2type: 't3.small' });
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
##### `enabledIMDSv2`<sup>Optional</sup> <a name="enabledIMDSv2" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.enabledIMDSv2"></a>
|
|
398
647
|
|
|
399
648
|
```typescript
|
|
400
649
|
public readonly enabledIMDSv2: boolean;
|
|
401
650
|
```
|
|
402
651
|
|
|
403
|
-
- *Type:*
|
|
652
|
+
- *Type:* boolean
|
|
404
653
|
- *Default:* false
|
|
405
654
|
|
|
406
655
|
Enabled IMDSv2.
|
|
@@ -409,143 +658,209 @@ more detail see https://docs.aws.amazon.com/zh_tw/AWSEC2/latest/UserGuide/config
|
|
|
409
658
|
|
|
410
659
|
---
|
|
411
660
|
|
|
412
|
-
##### `gitlabRunnerImage`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabRunnerImage"></a>
|
|
661
|
+
##### `gitlabRunnerImage`<sup>Optional</sup> <a name="gitlabRunnerImage" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlabRunnerImage"></a>
|
|
413
662
|
|
|
414
663
|
```typescript
|
|
415
664
|
public readonly gitlabRunnerImage: string;
|
|
416
665
|
```
|
|
417
666
|
|
|
418
|
-
- *Type:*
|
|
667
|
+
- *Type:* string
|
|
419
668
|
- *Default:* public.ecr.aws/gitlab/gitlab-runner:latest !!! <--- latest now > 16.0 Gitlab Runner version
|
|
420
669
|
|
|
421
670
|
Image URL of Gitlab Runner.
|
|
422
671
|
|
|
423
672
|
---
|
|
424
673
|
|
|
425
|
-
|
|
674
|
+
*Example*
|
|
675
|
+
|
|
676
|
+
```typescript
|
|
677
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', gitlabRunnerImage: 'gitlab/gitlab-runner:alpine' });
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
##### `gitlaburl`<sup>Optional</sup> <a name="gitlaburl" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.gitlaburl"></a>
|
|
426
682
|
|
|
427
683
|
```typescript
|
|
428
684
|
public readonly gitlaburl: string;
|
|
429
685
|
```
|
|
430
686
|
|
|
431
|
-
- *Type:*
|
|
687
|
+
- *Type:* string
|
|
432
688
|
- *Default:* gitlaburl='https://gitlab.com/' , please use https://yourgitlab.com/ do not use https://yourgitlab.com
|
|
433
689
|
|
|
434
690
|
Gitlab Runner register url .
|
|
435
691
|
|
|
436
692
|
---
|
|
437
693
|
|
|
438
|
-
|
|
694
|
+
*Example*
|
|
695
|
+
|
|
696
|
+
```typescript
|
|
697
|
+
const runner = new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN',gitlaburl: 'https://gitlab.com/'});
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
##### `instanceInterruptionBehavior`<sup>Optional</sup> <a name="instanceInterruptionBehavior" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.instanceInterruptionBehavior"></a>
|
|
439
702
|
|
|
440
703
|
```typescript
|
|
441
704
|
public readonly instanceInterruptionBehavior: InstanceInterruptionBehavior;
|
|
442
705
|
```
|
|
443
706
|
|
|
444
|
-
- *Type:*
|
|
707
|
+
- *Type:* <a href="#cdk-gitlab-runner.InstanceInterruptionBehavior">InstanceInterruptionBehavior</a>
|
|
445
708
|
- *Default:* InstanceInterruptionBehavior.TERMINATE , !!! only support spotfleet runner !!! .
|
|
446
709
|
|
|
447
710
|
The behavior when a Spot Runner Instance is interrupted.
|
|
448
711
|
|
|
449
712
|
---
|
|
450
713
|
|
|
451
|
-
##### `keyName`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.keyName"></a>
|
|
714
|
+
##### `keyName`<sup>Optional</sup> <a name="keyName" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.keyName"></a>
|
|
452
715
|
|
|
453
716
|
```typescript
|
|
454
717
|
public readonly keyName: string;
|
|
455
718
|
```
|
|
456
719
|
|
|
457
|
-
- *Type:*
|
|
720
|
+
- *Type:* string
|
|
458
721
|
- *Default:* no ssh key will be assigned , !!! only support spotfleet runner !!! .
|
|
459
722
|
|
|
460
723
|
SSH key name.
|
|
461
724
|
|
|
462
725
|
---
|
|
463
726
|
|
|
464
|
-
##### `runnerDescription`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.runnerDescription"></a>
|
|
727
|
+
##### `runnerDescription`<sup>Optional</sup> <a name="runnerDescription" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.runnerDescription"></a>
|
|
465
728
|
|
|
466
729
|
```typescript
|
|
467
730
|
public readonly runnerDescription: string;
|
|
468
731
|
```
|
|
469
732
|
|
|
470
|
-
- *Type:*
|
|
733
|
+
- *Type:* string
|
|
471
734
|
- *Default:* runnerDescription='Docker Runner'
|
|
472
735
|
|
|
473
736
|
Gitlab Runner description.
|
|
474
737
|
|
|
475
738
|
---
|
|
476
739
|
|
|
477
|
-
|
|
740
|
+
*Example*
|
|
741
|
+
|
|
742
|
+
```typescript
|
|
743
|
+
const runner = new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN',runnerDescription: 'Simple GitLab Runner'});
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
##### `selfvpc`<sup>Optional</sup> <a name="selfvpc" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.selfvpc"></a>
|
|
478
748
|
|
|
479
749
|
```typescript
|
|
480
750
|
public readonly selfvpc: IVpc;
|
|
481
751
|
```
|
|
482
752
|
|
|
483
|
-
- *Type:*
|
|
753
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
484
754
|
- *Default:* new VPC will be created , 1 Vpc , 2 Public Subnet .
|
|
485
755
|
|
|
486
756
|
VPC for the Gitlab Runner .
|
|
487
757
|
|
|
488
758
|
---
|
|
489
759
|
|
|
490
|
-
|
|
760
|
+
*Example*
|
|
761
|
+
|
|
762
|
+
```typescript
|
|
763
|
+
const newvpc = new Vpc(stack, 'NEWVPC', {
|
|
764
|
+
ipAddresses: IpAddresses.cidr('10.0.0.0/16'),
|
|
765
|
+
maxAzs: 2,
|
|
766
|
+
subnetConfiguration: [{
|
|
767
|
+
cidrMask: 26,
|
|
768
|
+
name: 'RunnerVPC',
|
|
769
|
+
subnetType: SubnetType.PUBLIC,
|
|
770
|
+
}],
|
|
771
|
+
natGateways: 0,
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN', selfvpc: newvpc });
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
##### `spotFleet`<sup>Optional</sup> <a name="spotFleet" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.spotFleet"></a>
|
|
491
779
|
|
|
492
780
|
```typescript
|
|
493
781
|
public readonly spotFleet: boolean;
|
|
494
782
|
```
|
|
495
783
|
|
|
496
|
-
- *Type:*
|
|
784
|
+
- *Type:* boolean
|
|
497
785
|
- *Default:* spotFleet=false
|
|
498
786
|
|
|
499
787
|
Gitlab Runner instance Use Spot Fleet or not ?!.
|
|
500
788
|
|
|
501
789
|
---
|
|
502
790
|
|
|
503
|
-
|
|
791
|
+
*Example*
|
|
792
|
+
|
|
793
|
+
```typescript
|
|
794
|
+
const runner = new GitlabContainerRunner(stack, 'runner', { gitlabtoken: 'GITLAB_TOKEN',spotFleet: true});
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
##### `tags`<sup>Optional</sup> <a name="tags" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.tags"></a>
|
|
504
799
|
|
|
505
800
|
```typescript
|
|
506
801
|
public readonly tags: string[];
|
|
507
802
|
```
|
|
508
803
|
|
|
509
|
-
- *Type:*
|
|
804
|
+
- *Type:* string[]
|
|
510
805
|
- *Default:* ['runner', 'gitlab', 'awscdk']
|
|
511
806
|
|
|
512
807
|
tags for the runner Unsupported Gitlab Runner 15.10 and later.
|
|
513
808
|
|
|
514
|
-
>
|
|
809
|
+
> [ - https://docs.gitlab.com/ee/ci/runners/new_creation_workflow.html]( - https://docs.gitlab.com/ee/ci/runners/new_creation_workflow.html)
|
|
515
810
|
|
|
516
811
|
---
|
|
517
812
|
|
|
518
|
-
##### `validUntil`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.validUntil"></a>
|
|
813
|
+
##### `validUntil`<sup>Optional</sup> <a name="validUntil" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.validUntil"></a>
|
|
519
814
|
|
|
520
815
|
```typescript
|
|
521
816
|
public readonly validUntil: string;
|
|
522
817
|
```
|
|
523
818
|
|
|
524
|
-
- *Type:*
|
|
819
|
+
- *Type:* string
|
|
525
820
|
- *Default:* no expiration , !!! only support spotfleet runner !!! .
|
|
526
821
|
|
|
527
822
|
the time when the spot fleet allocation expires.
|
|
528
823
|
|
|
529
824
|
---
|
|
530
825
|
|
|
531
|
-
##### `vpcSubnet`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabContainerRunnerProps.property.vpcSubnet"></a>
|
|
826
|
+
##### `vpcSubnet`<sup>Optional</sup> <a name="vpcSubnet" id="cdk-gitlab-runner.GitlabContainerRunnerProps.property.vpcSubnet"></a>
|
|
532
827
|
|
|
533
828
|
```typescript
|
|
534
829
|
public readonly vpcSubnet: SubnetSelection;
|
|
535
830
|
```
|
|
536
831
|
|
|
537
|
-
- *Type:*
|
|
832
|
+
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
|
|
538
833
|
- *Default:* public subnet
|
|
539
834
|
|
|
540
835
|
VPC subnet for the spot fleet.
|
|
541
836
|
|
|
542
837
|
---
|
|
543
838
|
|
|
544
|
-
|
|
839
|
+
*Example*
|
|
840
|
+
|
|
841
|
+
```typescript
|
|
842
|
+
const vpc = new Vpc(stack, 'nat', {
|
|
843
|
+
natGateways: 1,
|
|
844
|
+
maxAzs: 2,
|
|
845
|
+
});
|
|
846
|
+
const runner = new GitlabContainerRunner(stack, 'testing', {
|
|
847
|
+
gitlabtoken: 'GITLAB_TOKEN',
|
|
848
|
+
ec2type: 't3.large',
|
|
849
|
+
ec2iamrole: role,
|
|
850
|
+
ebsSize: 100,
|
|
851
|
+
selfvpc: vpc,
|
|
852
|
+
vpcSubnet: {
|
|
853
|
+
subnetType: SubnetType.PUBLIC,
|
|
854
|
+
},
|
|
855
|
+
});
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
### GitlabRunnerAutoscalingProps <a name="GitlabRunnerAutoscalingProps" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps"></a>
|
|
545
860
|
|
|
546
861
|
GitlabRunnerAutoscaling Props.
|
|
547
862
|
|
|
548
|
-
#### Initializer <a name="
|
|
863
|
+
#### Initializer <a name="Initializer" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.Initializer"></a>
|
|
549
864
|
|
|
550
865
|
```typescript
|
|
551
866
|
import { GitlabRunnerAutoscalingProps } from 'cdk-gitlab-runner'
|
|
@@ -553,41 +868,68 @@ import { GitlabRunnerAutoscalingProps } from 'cdk-gitlab-runner'
|
|
|
553
868
|
const gitlabRunnerAutoscalingProps: GitlabRunnerAutoscalingProps = { ... }
|
|
554
869
|
```
|
|
555
870
|
|
|
556
|
-
|
|
871
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
872
|
+
|
|
873
|
+
| **Name** | **Type** | **Description** |
|
|
874
|
+
| --- | --- | --- |
|
|
875
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabRunnerVersion">gitlabRunnerVersion</a></code> | <code>string</code> | Gitlab Runner version Please give me gitlab runner version. |
|
|
876
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabToken">gitlabToken</a></code> | <code>string</code> | Gitlab token. |
|
|
877
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.alarms">alarms</a></code> | <code>object[]</code> | Parameters of put_metric_alarm function. |
|
|
878
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.desiredCapacity">desiredCapacity</a></code> | <code>number</code> | Desired capacity limit for autoscaling group. |
|
|
879
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.dockerVolumes">dockerVolumes</a></code> | <code><a href="#cdk-gitlab-runner.DockerVolumes">DockerVolumes</a>[]</code> | add another Gitlab Container Runner Docker Volumes Path at job runner runtime. |
|
|
880
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.ebsSize">ebsSize</a></code> | <code>number</code> | Gitlab Runner instance EBS size . |
|
|
881
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabRunnerImage">gitlabRunnerImage</a></code> | <code>string</code> | Image URL of Gitlab Runner. |
|
|
882
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabUrl">gitlabUrl</a></code> | <code>string</code> | Gitlab Runner register url . |
|
|
883
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.instanceRole">instanceRole</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | IAM role for the Gitlab Runner Instance . |
|
|
884
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.instanceType">instanceType</a></code> | <code>string</code> | Runner default EC2 instance type. |
|
|
885
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.maxCapacity">maxCapacity</a></code> | <code>number</code> | Maximum capacity limit for autoscaling group. |
|
|
886
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.minCapacity">minCapacity</a></code> | <code>number</code> | Minimum capacity limit for autoscaling group. |
|
|
887
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.spotInstance">spotInstance</a></code> | <code>boolean</code> | Run worker nodes as EC2 Spot. |
|
|
888
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.tags">tags</a></code> | <code>string[]</code> | tags for the runner. |
|
|
889
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC for the Gitlab Runner . |
|
|
890
|
+
| <code><a href="#cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.vpcSubnet">vpcSubnet</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | VPC subnet. |
|
|
891
|
+
|
|
892
|
+
---
|
|
893
|
+
|
|
894
|
+
##### `gitlabRunnerVersion`<sup>Required</sup> <a name="gitlabRunnerVersion" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabRunnerVersion"></a>
|
|
557
895
|
|
|
558
896
|
```typescript
|
|
559
897
|
public readonly gitlabRunnerVersion: string;
|
|
560
898
|
```
|
|
561
899
|
|
|
562
|
-
- *Type:*
|
|
900
|
+
- *Type:* string
|
|
563
901
|
|
|
564
902
|
Gitlab Runner version Please give me gitlab runner version.
|
|
565
903
|
|
|
566
904
|
---
|
|
567
905
|
|
|
568
|
-
##### `gitlabToken`<sup>Required</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabToken"></a>
|
|
906
|
+
##### `gitlabToken`<sup>Required</sup> <a name="gitlabToken" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabToken"></a>
|
|
569
907
|
|
|
570
908
|
```typescript
|
|
571
909
|
public readonly gitlabToken: string;
|
|
572
910
|
```
|
|
573
911
|
|
|
574
|
-
- *Type:*
|
|
912
|
+
- *Type:* string
|
|
575
913
|
|
|
576
914
|
Gitlab token.
|
|
577
915
|
|
|
578
916
|
---
|
|
579
917
|
|
|
580
|
-
|
|
918
|
+
*Example*
|
|
919
|
+
|
|
920
|
+
```typescript
|
|
921
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN' });
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
##### `alarms`<sup>Optional</sup> <a name="alarms" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.alarms"></a>
|
|
581
926
|
|
|
582
927
|
```typescript
|
|
583
928
|
public readonly alarms: object[];
|
|
584
929
|
```
|
|
585
930
|
|
|
586
|
-
- *Type:*
|
|
587
|
-
- *Default:* [{
|
|
588
|
-
AlarmName: 'GitlabRunnerDiskUsage',
|
|
589
|
-
MetricName: 'disk_used_percent',
|
|
590
|
-
}]
|
|
931
|
+
- *Type:* object[]
|
|
932
|
+
- *Default:* [{ AlarmName: 'GitlabRunnerDiskUsage', MetricName: 'disk_used_percent', }]
|
|
591
933
|
|
|
592
934
|
Parameters of put_metric_alarm function.
|
|
593
935
|
|
|
@@ -595,26 +937,33 @@ https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloud
|
|
|
595
937
|
|
|
596
938
|
---
|
|
597
939
|
|
|
598
|
-
##### `desiredCapacity`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.desiredCapacity"></a>
|
|
940
|
+
##### `desiredCapacity`<sup>Optional</sup> <a name="desiredCapacity" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.desiredCapacity"></a>
|
|
599
941
|
|
|
600
942
|
```typescript
|
|
601
943
|
public readonly desiredCapacity: number;
|
|
602
944
|
```
|
|
603
945
|
|
|
604
|
-
- *Type:*
|
|
946
|
+
- *Type:* number
|
|
605
947
|
- *Default:* minCapacity, and leave unchanged during deployment
|
|
606
948
|
|
|
607
949
|
Desired capacity limit for autoscaling group.
|
|
608
950
|
|
|
609
951
|
---
|
|
610
952
|
|
|
611
|
-
|
|
953
|
+
*Example*
|
|
954
|
+
|
|
955
|
+
```typescript
|
|
956
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', desiredCapacity: 2 });
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
##### `dockerVolumes`<sup>Optional</sup> <a name="dockerVolumes" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.dockerVolumes"></a>
|
|
612
961
|
|
|
613
962
|
```typescript
|
|
614
963
|
public readonly dockerVolumes: DockerVolumes[];
|
|
615
964
|
```
|
|
616
965
|
|
|
617
|
-
- *Type:*
|
|
966
|
+
- *Type:* <a href="#cdk-gitlab-runner.DockerVolumes">DockerVolumes</a>[]
|
|
618
967
|
- *Default:* already mount "/var/run/docker.sock:/var/run/docker.sock"
|
|
619
968
|
|
|
620
969
|
add another Gitlab Container Runner Docker Volumes Path at job runner runtime.
|
|
@@ -623,172 +972,287 @@ more detail see https://docs.gitlab.com/runner/configuration/advanced-configurat
|
|
|
623
972
|
|
|
624
973
|
---
|
|
625
974
|
|
|
626
|
-
|
|
975
|
+
*Example*
|
|
976
|
+
|
|
977
|
+
```typescript
|
|
978
|
+
dockerVolumes: [
|
|
979
|
+
{
|
|
980
|
+
hostPath: '/tmp/cache',
|
|
981
|
+
containerPath: '/tmp/cache',
|
|
982
|
+
},
|
|
983
|
+
],
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
##### `ebsSize`<sup>Optional</sup> <a name="ebsSize" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.ebsSize"></a>
|
|
627
988
|
|
|
628
989
|
```typescript
|
|
629
990
|
public readonly ebsSize: number;
|
|
630
991
|
```
|
|
631
992
|
|
|
632
|
-
- *Type:*
|
|
993
|
+
- *Type:* number
|
|
633
994
|
- *Default:* ebsSize=60
|
|
634
995
|
|
|
635
996
|
Gitlab Runner instance EBS size .
|
|
636
997
|
|
|
637
998
|
---
|
|
638
999
|
|
|
639
|
-
|
|
1000
|
+
*Example*
|
|
1001
|
+
|
|
1002
|
+
```typescript
|
|
1003
|
+
const runner = new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', ebsSize: 100});
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
##### `gitlabRunnerImage`<sup>Optional</sup> <a name="gitlabRunnerImage" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabRunnerImage"></a>
|
|
640
1008
|
|
|
641
1009
|
```typescript
|
|
642
1010
|
public readonly gitlabRunnerImage: string;
|
|
643
1011
|
```
|
|
644
1012
|
|
|
645
|
-
- *Type:*
|
|
1013
|
+
- *Type:* string
|
|
646
1014
|
- *Default:* public.ecr.aws/gitlab/gitlab-runner:latest
|
|
647
1015
|
|
|
648
1016
|
Image URL of Gitlab Runner.
|
|
649
1017
|
|
|
650
1018
|
---
|
|
651
1019
|
|
|
652
|
-
|
|
1020
|
+
*Example*
|
|
1021
|
+
|
|
1022
|
+
```typescript
|
|
1023
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', gitlabRunnerImage: 'gitlab/gitlab-runner:alpine' });
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
##### `gitlabUrl`<sup>Optional</sup> <a name="gitlabUrl" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.gitlabUrl"></a>
|
|
653
1028
|
|
|
654
1029
|
```typescript
|
|
655
1030
|
public readonly gitlabUrl: string;
|
|
656
1031
|
```
|
|
657
1032
|
|
|
658
|
-
- *Type:*
|
|
1033
|
+
- *Type:* string
|
|
659
1034
|
- *Default:* https://gitlab.com/ , The trailing slash is mandatory.
|
|
660
1035
|
|
|
661
1036
|
Gitlab Runner register url .
|
|
662
1037
|
|
|
663
1038
|
---
|
|
664
1039
|
|
|
665
|
-
|
|
1040
|
+
*Example*
|
|
1041
|
+
|
|
1042
|
+
```typescript
|
|
1043
|
+
const runner = new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN',gitlabUrl: 'https://gitlab.com/'});
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
##### `instanceRole`<sup>Optional</sup> <a name="instanceRole" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.instanceRole"></a>
|
|
666
1048
|
|
|
667
1049
|
```typescript
|
|
668
1050
|
public readonly instanceRole: IRole;
|
|
669
1051
|
```
|
|
670
1052
|
|
|
671
|
-
- *Type:*
|
|
1053
|
+
- *Type:* aws-cdk-lib.aws_iam.IRole
|
|
672
1054
|
- *Default:* new Role for Gitlab Runner Instance , attach AmazonSSMManagedInstanceCore Policy .
|
|
673
1055
|
|
|
674
1056
|
IAM role for the Gitlab Runner Instance .
|
|
675
1057
|
|
|
676
1058
|
---
|
|
677
1059
|
|
|
678
|
-
|
|
1060
|
+
*Example*
|
|
1061
|
+
|
|
1062
|
+
```typescript
|
|
1063
|
+
const role = new Role(stack, 'runner-role', {
|
|
1064
|
+
assumedBy: new ServicePrincipal('ec2.amazonaws.com'),
|
|
1065
|
+
description: 'For Gitlab Runner Test Role',
|
|
1066
|
+
roleName: 'Runner-Role',
|
|
1067
|
+
});
|
|
1068
|
+
|
|
1069
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', instanceRole: role });
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
##### `instanceType`<sup>Optional</sup> <a name="instanceType" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.instanceType"></a>
|
|
679
1074
|
|
|
680
1075
|
```typescript
|
|
681
1076
|
public readonly instanceType: string;
|
|
682
1077
|
```
|
|
683
1078
|
|
|
684
|
-
- *Type:*
|
|
1079
|
+
- *Type:* string
|
|
685
1080
|
- *Default:* t3.micro
|
|
686
1081
|
|
|
687
1082
|
Runner default EC2 instance type.
|
|
688
1083
|
|
|
689
1084
|
---
|
|
690
1085
|
|
|
691
|
-
|
|
1086
|
+
*Example*
|
|
1087
|
+
|
|
1088
|
+
```typescript
|
|
1089
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', instanceType: 't3.small' });
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
##### `maxCapacity`<sup>Optional</sup> <a name="maxCapacity" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.maxCapacity"></a>
|
|
692
1094
|
|
|
693
1095
|
```typescript
|
|
694
1096
|
public readonly maxCapacity: number;
|
|
695
1097
|
```
|
|
696
1098
|
|
|
697
|
-
- *Type:*
|
|
1099
|
+
- *Type:* number
|
|
698
1100
|
- *Default:* desiredCapacity
|
|
699
1101
|
|
|
700
1102
|
Maximum capacity limit for autoscaling group.
|
|
701
1103
|
|
|
702
1104
|
---
|
|
703
1105
|
|
|
704
|
-
|
|
1106
|
+
*Example*
|
|
1107
|
+
|
|
1108
|
+
```typescript
|
|
1109
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', maxCapacity: 4 });
|
|
1110
|
+
```
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
##### `minCapacity`<sup>Optional</sup> <a name="minCapacity" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.minCapacity"></a>
|
|
705
1114
|
|
|
706
1115
|
```typescript
|
|
707
1116
|
public readonly minCapacity: number;
|
|
708
1117
|
```
|
|
709
1118
|
|
|
710
|
-
- *Type:*
|
|
1119
|
+
- *Type:* number
|
|
711
1120
|
- *Default:* minCapacity: 1
|
|
712
1121
|
|
|
713
1122
|
Minimum capacity limit for autoscaling group.
|
|
714
1123
|
|
|
715
1124
|
---
|
|
716
1125
|
|
|
717
|
-
|
|
1126
|
+
*Example*
|
|
1127
|
+
|
|
1128
|
+
```typescript
|
|
1129
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', minCapacity: 2 });
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
##### `spotInstance`<sup>Optional</sup> <a name="spotInstance" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.spotInstance"></a>
|
|
718
1134
|
|
|
719
1135
|
```typescript
|
|
720
1136
|
public readonly spotInstance: boolean;
|
|
721
1137
|
```
|
|
722
1138
|
|
|
723
|
-
- *Type:*
|
|
1139
|
+
- *Type:* boolean
|
|
724
1140
|
- *Default:* false
|
|
725
1141
|
|
|
726
1142
|
Run worker nodes as EC2 Spot.
|
|
727
1143
|
|
|
728
1144
|
---
|
|
729
1145
|
|
|
730
|
-
##### `tags`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.tags"></a>
|
|
1146
|
+
##### `tags`<sup>Optional</sup> <a name="tags" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.tags"></a>
|
|
731
1147
|
|
|
732
1148
|
```typescript
|
|
733
1149
|
public readonly tags: string[];
|
|
734
1150
|
```
|
|
735
1151
|
|
|
736
|
-
- *Type:*
|
|
1152
|
+
- *Type:* string[]
|
|
737
1153
|
- *Default:* ['runner', 'gitlab', 'awscdk']
|
|
738
1154
|
|
|
739
1155
|
tags for the runner.
|
|
740
1156
|
|
|
741
1157
|
---
|
|
742
1158
|
|
|
743
|
-
##### `vpc`<sup>Optional</sup> <a name="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.vpc"></a>
|
|
1159
|
+
##### `vpc`<sup>Optional</sup> <a name="vpc" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.vpc"></a>
|
|
744
1160
|
|
|
745
1161
|
```typescript
|
|
746
1162
|
public readonly vpc: IVpc;
|
|
747
1163
|
```
|
|
748
1164
|
|
|
749
|
-
- *Type:*
|
|
1165
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
750
1166
|
- *Default:* A new VPC will be created.
|
|
751
1167
|
|
|
752
1168
|
VPC for the Gitlab Runner .
|
|
753
1169
|
|
|
754
1170
|
---
|
|
755
1171
|
|
|
756
|
-
|
|
1172
|
+
*Example*
|
|
1173
|
+
|
|
1174
|
+
```typescript
|
|
1175
|
+
const newVpc = new Vpc(stack, 'NewVPC', {
|
|
1176
|
+
ipAddresses: IpAddresses.cidr('10.0.0.0/16'),
|
|
1177
|
+
maxAzs: 2,
|
|
1178
|
+
subnetConfiguration: [{
|
|
1179
|
+
cidrMask: 26,
|
|
1180
|
+
name: 'RunnerVPC',
|
|
1181
|
+
subnetType: SubnetType.PUBLIC,
|
|
1182
|
+
}],
|
|
1183
|
+
natGateways: 0,
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
new GitlabRunnerAutoscaling(stack, 'runner', { gitlabToken: 'GITLAB_TOKEN', vpc: newVpc });
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
##### `vpcSubnet`<sup>Optional</sup> <a name="vpcSubnet" id="cdk-gitlab-runner.GitlabRunnerAutoscalingProps.property.vpcSubnet"></a>
|
|
757
1191
|
|
|
758
1192
|
```typescript
|
|
759
1193
|
public readonly vpcSubnet: SubnetSelection;
|
|
760
1194
|
```
|
|
761
1195
|
|
|
762
|
-
- *Type:*
|
|
1196
|
+
- *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
|
|
763
1197
|
- *Default:* SubnetType.PRIVATE subnet
|
|
764
1198
|
|
|
765
1199
|
VPC subnet.
|
|
766
1200
|
|
|
767
1201
|
---
|
|
768
1202
|
|
|
1203
|
+
*Example*
|
|
1204
|
+
|
|
1205
|
+
```typescript
|
|
1206
|
+
const vpc = new Vpc(stack, 'nat', {
|
|
1207
|
+
natGateways: 1,
|
|
1208
|
+
maxAzs: 2,
|
|
1209
|
+
});
|
|
1210
|
+
const runner = new GitlabRunnerAutoscaling(stack, 'testing', {
|
|
1211
|
+
gitlabToken: 'GITLAB_TOKEN',
|
|
1212
|
+
instanceType: 't3.large',
|
|
1213
|
+
instanceRole: role,
|
|
1214
|
+
ebsSize: 100,
|
|
1215
|
+
vpc: vpc,
|
|
1216
|
+
vpcSubnet: {
|
|
1217
|
+
subnetType: SubnetType.PUBLIC,
|
|
1218
|
+
},
|
|
1219
|
+
});
|
|
1220
|
+
```
|
|
769
1221
|
|
|
770
1222
|
|
|
771
|
-
## Enums <a name="Enums"></a>
|
|
772
1223
|
|
|
773
|
-
|
|
1224
|
+
|
|
1225
|
+
## Enums <a name="Enums" id="Enums"></a>
|
|
1226
|
+
|
|
1227
|
+
### InstanceInterruptionBehavior <a name="InstanceInterruptionBehavior" id="cdk-gitlab-runner.InstanceInterruptionBehavior"></a>
|
|
774
1228
|
|
|
775
1229
|
InstanceInterruptionBehavior enum.
|
|
776
1230
|
|
|
777
|
-
####
|
|
1231
|
+
#### Members <a name="Members" id="Members"></a>
|
|
1232
|
+
|
|
1233
|
+
| **Name** | **Description** |
|
|
1234
|
+
| --- | --- |
|
|
1235
|
+
| <code><a href="#cdk-gitlab-runner.InstanceInterruptionBehavior.HIBERNATE">HIBERNATE</a></code> | hibernate. |
|
|
1236
|
+
| <code><a href="#cdk-gitlab-runner.InstanceInterruptionBehavior.STOP">STOP</a></code> | stop. |
|
|
1237
|
+
| <code><a href="#cdk-gitlab-runner.InstanceInterruptionBehavior.TERMINATE">TERMINATE</a></code> | terminate. |
|
|
1238
|
+
|
|
1239
|
+
---
|
|
1240
|
+
|
|
1241
|
+
##### `HIBERNATE` <a name="HIBERNATE" id="cdk-gitlab-runner.InstanceInterruptionBehavior.HIBERNATE"></a>
|
|
778
1242
|
|
|
779
1243
|
hibernate.
|
|
780
1244
|
|
|
781
1245
|
---
|
|
782
1246
|
|
|
783
1247
|
|
|
784
|
-
|
|
1248
|
+
##### `STOP` <a name="STOP" id="cdk-gitlab-runner.InstanceInterruptionBehavior.STOP"></a>
|
|
785
1249
|
|
|
786
1250
|
stop.
|
|
787
1251
|
|
|
788
1252
|
---
|
|
789
1253
|
|
|
790
1254
|
|
|
791
|
-
|
|
1255
|
+
##### `TERMINATE` <a name="TERMINATE" id="cdk-gitlab-runner.InstanceInterruptionBehavior.TERMINATE"></a>
|
|
792
1256
|
|
|
793
1257
|
terminate.
|
|
794
1258
|
|