@cloudsnorkel/cdk-github-runners 0.0.11 → 0.0.14

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/API.md CHANGED
@@ -10,6 +10,8 @@ GitHub Actions runner provider using CodeBuild to execute the actions.
10
10
 
11
11
  Creates a project that gets started for each job.
12
12
 
13
+ This construct is not meant to be used by itself. It should be passed in the providers property for GitHubRunners.
14
+
13
15
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.Initializer"></a>
14
16
 
15
17
  ```typescript
@@ -49,7 +51,7 @@ new CodeBuildRunner(scope: Construct, id: string, props: CodeBuildRunnerProps)
49
51
  | **Name** | **Description** |
50
52
  | --- | --- |
51
53
  | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.toString">toString</a></code> | Returns a string representation of this construct. |
52
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function tasks that execute the runner. |
54
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function task(s) to start a new runner. |
53
55
 
54
56
  ---
55
57
 
@@ -67,12 +69,16 @@ Returns a string representation of this construct.
67
69
  public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
68
70
  ```
69
71
 
70
- Generate step function tasks that execute the runner.
72
+ Generate step function task(s) to start a new runner.
73
+
74
+ Called by GithubRunners and shouldn't be called manually.
71
75
 
72
76
  ###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.getStepFunctionTask.parameter.parameters"></a>
73
77
 
74
78
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>
75
79
 
80
+ workflow job details.
81
+
76
82
  ---
77
83
 
78
84
  #### Static Functions <a name="Static Functions" id="Static Functions"></a>
@@ -107,11 +113,11 @@ Any object.
107
113
  | --- | --- | --- |
108
114
  | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
109
115
  | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
110
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
111
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.label">label</a></code> | <code>string</code> | GitHub Actions label associated with this runner provider. |
112
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.project">project</a></code> | <code>aws-cdk-lib.aws_codebuild.Project</code> | *No description.* |
113
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group associated with runners. |
114
- | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC network in which runners will be placed. |
116
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
117
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.label">label</a></code> | <code>string</code> | Label associated with this provider. |
118
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.project">project</a></code> | <code>aws-cdk-lib.aws_codebuild.Project</code> | CodeBuild project hosting the runner. |
119
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group attached to the task. |
120
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC used for hosting the project. |
115
121
 
116
122
  ---
117
123
 
@@ -147,7 +153,7 @@ public readonly grantPrincipal: IPrincipal;
147
153
 
148
154
  - *Type:* aws-cdk-lib.aws_iam.IPrincipal
149
155
 
150
- The principal to grant permissions to.
156
+ Grant principal used to add permissions to the runner role.
151
157
 
152
158
  ---
153
159
 
@@ -159,7 +165,7 @@ public readonly label: string;
159
165
 
160
166
  - *Type:* string
161
167
 
162
- GitHub Actions label associated with this runner provider.
168
+ Label associated with this provider.
163
169
 
164
170
  ---
165
171
 
@@ -171,6 +177,8 @@ public readonly project: Project;
171
177
 
172
178
  - *Type:* aws-cdk-lib.aws_codebuild.Project
173
179
 
180
+ CodeBuild project hosting the runner.
181
+
174
182
  ---
175
183
 
176
184
  ##### `securityGroup`<sup>Optional</sup> <a name="securityGroup" id="@cloudsnorkel/cdk-github-runners.CodeBuildRunner.property.securityGroup"></a>
@@ -181,7 +189,7 @@ public readonly securityGroup: ISecurityGroup;
181
189
 
182
190
  - *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
183
191
 
184
- Security group associated with runners.
192
+ Security group attached to the task.
185
193
 
186
194
  ---
187
195
 
@@ -193,7 +201,7 @@ public readonly vpc: IVpc;
193
201
 
194
202
  - *Type:* aws-cdk-lib.aws_ec2.IVpc
195
203
 
196
- VPC network in which runners will be placed.
204
+ VPC used for hosting the project.
197
205
 
198
206
  ---
199
207
 
@@ -206,6 +214,8 @@ GitHub Actions runner provider using Fargate to execute the actions.
206
214
 
207
215
  Creates a task definition with a single container that gets started for each job.
208
216
 
217
+ This construct is not meant to be used by itself. It should be passed in the providers property for GitHubRunners.
218
+
209
219
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.FargateRunner.Initializer"></a>
210
220
 
211
221
  ```typescript
@@ -245,7 +255,7 @@ new FargateRunner(scope: Construct, id: string, props: FargateRunnerProps)
245
255
  | **Name** | **Description** |
246
256
  | --- | --- |
247
257
  | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.toString">toString</a></code> | Returns a string representation of this construct. |
248
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function tasks that execute the runner. |
258
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function task(s) to start a new runner. |
249
259
 
250
260
  ---
251
261
 
@@ -263,12 +273,16 @@ Returns a string representation of this construct.
263
273
  public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
264
274
  ```
265
275
 
266
- Generate step function tasks that execute the runner.
276
+ Generate step function task(s) to start a new runner.
277
+
278
+ Called by GithubRunners and shouldn't be called manually.
267
279
 
268
280
  ###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.FargateRunner.getStepFunctionTask.parameter.parameters"></a>
269
281
 
270
282
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>
271
283
 
284
+ workflow job details.
285
+
272
286
  ---
273
287
 
274
288
  #### Static Functions <a name="Static Functions" id="Static Functions"></a>
@@ -302,15 +316,15 @@ Any object.
302
316
  | **Name** | **Type** | **Description** |
303
317
  | --- | --- | --- |
304
318
  | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
305
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | *No description.* |
306
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.cluster">cluster</a></code> | <code>aws-cdk-lib.aws_ecs.Cluster</code> | *No description.* |
319
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | Whether task will have a public IP. |
320
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.cluster">cluster</a></code> | <code>aws-cdk-lib.aws_ecs.Cluster</code> | Cluster hosting the task hosting the runner. |
307
321
  | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
308
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.container">container</a></code> | <code>aws-cdk-lib.aws_ecs.ContainerDefinition</code> | *No description.* |
309
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
310
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.label">label</a></code> | <code>string</code> | GitHub Actions label associated with this runner provider. |
311
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.task">task</a></code> | <code>aws-cdk-lib.aws_ecs.FargateTaskDefinition</code> | *No description.* |
312
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group associated with runners. |
313
- | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC network in which runners will be placed. |
322
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.container">container</a></code> | <code>aws-cdk-lib.aws_ecs.ContainerDefinition</code> | Container definition hosting the runner. |
323
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
324
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.label">label</a></code> | <code>string</code> | Label associated with this provider. |
325
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.task">task</a></code> | <code>aws-cdk-lib.aws_ecs.FargateTaskDefinition</code> | Fargate task hosting the runner. |
326
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group attached to the task. |
327
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.FargateRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC used for hosting the task. |
314
328
 
315
329
  ---
316
330
 
@@ -334,6 +348,8 @@ public readonly assignPublicIp: boolean;
334
348
 
335
349
  - *Type:* boolean
336
350
 
351
+ Whether task will have a public IP.
352
+
337
353
  ---
338
354
 
339
355
  ##### `cluster`<sup>Required</sup> <a name="cluster" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.cluster"></a>
@@ -344,6 +360,8 @@ public readonly cluster: Cluster;
344
360
 
345
361
  - *Type:* aws-cdk-lib.aws_ecs.Cluster
346
362
 
363
+ Cluster hosting the task hosting the runner.
364
+
347
365
  ---
348
366
 
349
367
  ##### `connections`<sup>Required</sup> <a name="connections" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.connections"></a>
@@ -366,6 +384,8 @@ public readonly container: ContainerDefinition;
366
384
 
367
385
  - *Type:* aws-cdk-lib.aws_ecs.ContainerDefinition
368
386
 
387
+ Container definition hosting the runner.
388
+
369
389
  ---
370
390
 
371
391
  ##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.grantPrincipal"></a>
@@ -376,7 +396,7 @@ public readonly grantPrincipal: IPrincipal;
376
396
 
377
397
  - *Type:* aws-cdk-lib.aws_iam.IPrincipal
378
398
 
379
- The principal to grant permissions to.
399
+ Grant principal used to add permissions to the runner role.
380
400
 
381
401
  ---
382
402
 
@@ -388,7 +408,7 @@ public readonly label: string;
388
408
 
389
409
  - *Type:* string
390
410
 
391
- GitHub Actions label associated with this runner provider.
411
+ Label associated with this provider.
392
412
 
393
413
  ---
394
414
 
@@ -400,6 +420,8 @@ public readonly task: FargateTaskDefinition;
400
420
 
401
421
  - *Type:* aws-cdk-lib.aws_ecs.FargateTaskDefinition
402
422
 
423
+ Fargate task hosting the runner.
424
+
403
425
  ---
404
426
 
405
427
  ##### `securityGroup`<sup>Optional</sup> <a name="securityGroup" id="@cloudsnorkel/cdk-github-runners.FargateRunner.property.securityGroup"></a>
@@ -410,7 +432,7 @@ public readonly securityGroup: ISecurityGroup;
410
432
 
411
433
  - *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
412
434
 
413
- Security group associated with runners.
435
+ Security group attached to the task.
414
436
 
415
437
  ---
416
438
 
@@ -422,13 +444,55 @@ public readonly vpc: IVpc;
422
444
 
423
445
  - *Type:* aws-cdk-lib.aws_ec2.IVpc
424
446
 
425
- VPC network in which runners will be placed.
447
+ VPC used for hosting the task.
426
448
 
427
449
  ---
428
450
 
429
451
 
430
452
  ### GitHubRunners <a name="GitHubRunners" id="@cloudsnorkel/cdk-github-runners.GitHubRunners"></a>
431
453
 
454
+ Create all the required infrastructure to provide self-hosted GitHub runners.
455
+
456
+ It creates a webhook, secrets, and a step function to orchestrate all runs. Secrets are not automatically filled. See README.md for instructions on how to setup GitHub integration.
457
+
458
+ By default, this will create a runner provider of each available type with the defaults. This is good enough for the initial setup stage when you just want to get GitHub integration working.
459
+
460
+ ```typescript
461
+ new GitHubRunners(stack, 'runners', {});
462
+ ```
463
+
464
+ Usually you'd want to configure the runner providers so the runners can run in a certain VPC or have certain permissions.
465
+
466
+ ```typescript
467
+ const vpc = ec2.Vpc.fromLookup(stack, 'vpc', { vpcId: 'vpc-1234567' });
468
+ const runnerSg = new ec2.SecurityGroup(stack, 'runner security group', { vpc: vpc });
469
+ const dbSg = ec2.SecurityGroup.fromSecurityGroupId(stack, 'database security group', 'sg-1234567');
470
+ const bucket = new s3.Bucket(stack, 'runner bucket');
471
+
472
+ // create a custom CodeBuild provider
473
+ const myProvider = new CodeBuildRunner(
474
+ stack, 'codebuild runner',
475
+ {
476
+ label: 'my-codebuild',
477
+ vpc: vpc,
478
+ securityGroup: runnerSg,
479
+ },
480
+ );
481
+ // grant some permissions to the provider
482
+ bucket.grantReadWrite(myProvider);
483
+ dbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), 'allow runners to connect to MySQL database');
484
+
485
+ // create the runner infrastructure
486
+ new GitHubRunners(
487
+ stack,
488
+ 'runners',
489
+ {
490
+ providers: [myProvider],
491
+ defaultProviderLabel: 'my-codebuild',
492
+ }
493
+ );
494
+ ```
495
+
432
496
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.Initializer"></a>
433
497
 
434
498
  ```typescript
@@ -510,10 +574,10 @@ Any object.
510
574
  | **Name** | **Type** | **Description** |
511
575
  | --- | --- | --- |
512
576
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
513
- | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.defaultProvider">defaultProvider</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a></code> | *No description.* |
577
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.defaultProvider">defaultProvider</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a></code> | Default provider as set by {@link GitHubRunnersProps.defaultProviderLabel}. |
514
578
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.props">props</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps">GitHubRunnersProps</a></code> | *No description.* |
515
- | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | *No description.* |
516
- | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.secrets">secrets</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets">Secrets</a></code> | *No description.* |
579
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | Configured runner providers. |
580
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.property.secrets">secrets</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets">Secrets</a></code> | Secrets for GitHub communication including webhook secret and runner authentication. |
517
581
 
518
582
  ---
519
583
 
@@ -537,6 +601,8 @@ public readonly defaultProvider: IRunnerProvider;
537
601
 
538
602
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
539
603
 
604
+ Default provider as set by {@link GitHubRunnersProps.defaultProviderLabel}.
605
+
540
606
  ---
541
607
 
542
608
  ##### `props`<sup>Required</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.property.props"></a>
@@ -557,6 +623,8 @@ public readonly providers: IRunnerProvider[];
557
623
 
558
624
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
559
625
 
626
+ Configured runner providers.
627
+
560
628
  ---
561
629
 
562
630
  ##### `secrets`<sup>Required</sup> <a name="secrets" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.property.secrets"></a>
@@ -567,6 +635,8 @@ public readonly secrets: Secrets;
567
635
 
568
636
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Secrets">Secrets</a>
569
637
 
638
+ Secrets for GitHub communication including webhook secret and runner authentication.
639
+
570
640
  ---
571
641
 
572
642
 
@@ -578,6 +648,8 @@ GitHub Actions runner provider using Lambda to execute the actions.
578
648
 
579
649
  Creates a Docker-based function that gets executed for each job.
580
650
 
651
+ This construct is not meant to be used by itself. It should be passed in the providers property for GitHubRunners.
652
+
581
653
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.Initializer"></a>
582
654
 
583
655
  ```typescript
@@ -617,7 +689,7 @@ new LambdaRunner(scope: Construct, id: string, props: LambdaRunnerProps)
617
689
  | **Name** | **Description** |
618
690
  | --- | --- |
619
691
  | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.toString">toString</a></code> | Returns a string representation of this construct. |
620
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function tasks that execute the runner. |
692
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function task(s) to start a new runner. |
621
693
 
622
694
  ---
623
695
 
@@ -635,12 +707,16 @@ Returns a string representation of this construct.
635
707
  public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
636
708
  ```
637
709
 
638
- Generate step function tasks that execute the runner.
710
+ Generate step function task(s) to start a new runner.
711
+
712
+ Called by GithubRunners and shouldn't be called manually.
639
713
 
640
714
  ###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.getStepFunctionTask.parameter.parameters"></a>
641
715
 
642
716
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>
643
717
 
718
+ workflow job details.
719
+
644
720
  ---
645
721
 
646
722
  #### Static Functions <a name="Static Functions" id="Static Functions"></a>
@@ -675,11 +751,11 @@ Any object.
675
751
  | --- | --- | --- |
676
752
  | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
677
753
  | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
678
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.function">function</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | *No description.* |
679
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
680
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.label">label</a></code> | <code>string</code> | GitHub Actions label associated with this runner provider. |
681
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group associated with runners. |
682
- | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC network in which runners will be placed. |
754
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.function">function</a></code> | <code>aws-cdk-lib.aws_lambda.Function</code> | The function hosting the GitHub runner. |
755
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
756
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.label">label</a></code> | <code>string</code> | Label associated with this provider. |
757
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.securityGroup">securityGroup</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup</code> | Security group attached to the function. |
758
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC used for hosting the function. |
683
759
 
684
760
  ---
685
761
 
@@ -715,6 +791,8 @@ public readonly function: Function;
715
791
 
716
792
  - *Type:* aws-cdk-lib.aws_lambda.Function
717
793
 
794
+ The function hosting the GitHub runner.
795
+
718
796
  ---
719
797
 
720
798
  ##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@cloudsnorkel/cdk-github-runners.LambdaRunner.property.grantPrincipal"></a>
@@ -725,7 +803,7 @@ public readonly grantPrincipal: IPrincipal;
725
803
 
726
804
  - *Type:* aws-cdk-lib.aws_iam.IPrincipal
727
805
 
728
- The principal to grant permissions to.
806
+ Grant principal used to add permissions to the runner role.
729
807
 
730
808
  ---
731
809
 
@@ -737,7 +815,7 @@ public readonly label: string;
737
815
 
738
816
  - *Type:* string
739
817
 
740
- GitHub Actions label associated with this runner provider.
818
+ Label associated with this provider.
741
819
 
742
820
  ---
743
821
 
@@ -749,7 +827,7 @@ public readonly securityGroup: ISecurityGroup;
749
827
 
750
828
  - *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup
751
829
 
752
- Security group associated with runners.
830
+ Security group attached to the function.
753
831
 
754
832
  ---
755
833
 
@@ -761,7 +839,7 @@ public readonly vpc: IVpc;
761
839
 
762
840
  - *Type:* aws-cdk-lib.aws_ec2.IVpc
763
841
 
764
- VPC network in which runners will be placed.
842
+ VPC used for hosting the function.
765
843
 
766
844
  ---
767
845
 
@@ -844,9 +922,9 @@ Any object.
844
922
  | **Name** | **Type** | **Description** |
845
923
  | --- | --- | --- |
846
924
  | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
847
- | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.github">github</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | *No description.* |
848
- | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.githubPrivateKey">githubPrivateKey</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | *No description.* |
849
- | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.webhook">webhook</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | *No description.* |
925
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.github">github</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | Authentication secret for GitHub containing either app details or personal authentication token. |
926
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.githubPrivateKey">githubPrivateKey</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | GitHub app private key. Not needed when using personal authentication tokens. |
927
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.Secrets.property.webhook">webhook</a></code> | <code>aws-cdk-lib.aws_secretsmanager.Secret</code> | Webhook secret used to confirm events are coming from GitHub and nowhere else. |
850
928
 
851
929
  ---
852
930
 
@@ -870,6 +948,13 @@ public readonly github: Secret;
870
948
 
871
949
  - *Type:* aws-cdk-lib.aws_secretsmanager.Secret
872
950
 
951
+ Authentication secret for GitHub containing either app details or personal authentication token.
952
+
953
+ This secret is used to register runners and
954
+ cancel jobs when the runner fails to start.
955
+
956
+ This secret is meant to be edited by the user after being created.
957
+
873
958
  ---
874
959
 
875
960
  ##### `githubPrivateKey`<sup>Required</sup> <a name="githubPrivateKey" id="@cloudsnorkel/cdk-github-runners.Secrets.property.githubPrivateKey"></a>
@@ -880,6 +965,10 @@ public readonly githubPrivateKey: Secret;
880
965
 
881
966
  - *Type:* aws-cdk-lib.aws_secretsmanager.Secret
882
967
 
968
+ GitHub app private key. Not needed when using personal authentication tokens.
969
+
970
+ This secret is meant to be edited by the user after being created.
971
+
883
972
  ---
884
973
 
885
974
  ##### `webhook`<sup>Required</sup> <a name="webhook" id="@cloudsnorkel/cdk-github-runners.Secrets.property.webhook"></a>
@@ -890,6 +979,8 @@ public readonly webhook: Secret;
890
979
 
891
980
  - *Type:* aws-cdk-lib.aws_secretsmanager.Secret
892
981
 
982
+ Webhook secret used to confirm events are coming from GitHub and nowhere else.
983
+
893
984
  ---
894
985
 
895
986
 
@@ -1035,6 +1126,8 @@ VPC to launch the runners in.
1035
1126
 
1036
1127
  ### FargateRunnerProps <a name="FargateRunnerProps" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps"></a>
1037
1128
 
1129
+ Properties for FargateRunner.
1130
+
1038
1131
  #### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.Initializer"></a>
1039
1132
 
1040
1133
  ```typescript
@@ -1101,6 +1194,8 @@ public readonly assignPublicIp: boolean;
1101
1194
 
1102
1195
  Assign public IP to the runner task.
1103
1196
 
1197
+ Make sure the task will have access to GitHub. A public IP might be required unless you have NAT gateway.
1198
+
1104
1199
  ---
1105
1200
 
1106
1201
  ##### `cluster`<sup>Optional</sup> <a name="cluster" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProps.property.cluster"></a>
@@ -1227,7 +1322,7 @@ VPC to launch the runners in.
1227
1322
 
1228
1323
  ### GitHubRunnersProps <a name="GitHubRunnersProps" id="@cloudsnorkel/cdk-github-runners.GitHubRunnersProps"></a>
1229
1324
 
1230
- Properties of the GitHubRunners.
1325
+ Properties for GitHubRunners.
1231
1326
 
1232
1327
  #### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.Initializer"></a>
1233
1328
 
@@ -1241,8 +1336,8 @@ const gitHubRunnersProps: GitHubRunnersProps = { ... }
1241
1336
 
1242
1337
  | **Name** | **Type** | **Description** |
1243
1338
  | --- | --- | --- |
1244
- | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.defaultProviderLabel">defaultProviderLabel</a></code> | <code>string</code> | *No description.* |
1245
- | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | *No description.* |
1339
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.defaultProviderLabel">defaultProviderLabel</a></code> | <code>string</code> | Label of default provider in case the workflow job doesn't specify any known label. |
1340
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunnersProps.property.providers">providers</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]</code> | List of runner providers to use. |
1246
1341
 
1247
1342
  ---
1248
1343
 
@@ -1253,6 +1348,11 @@ public readonly defaultProviderLabel: string;
1253
1348
  ```
1254
1349
 
1255
1350
  - *Type:* string
1351
+ - *Default:* 'codebuild'
1352
+
1353
+ Label of default provider in case the workflow job doesn't specify any known label.
1354
+
1355
+ A provider with that label must be configured.
1256
1356
 
1257
1357
  ---
1258
1358
 
@@ -1263,6 +1363,11 @@ public readonly providers: IRunnerProvider[];
1263
1363
  ```
1264
1364
 
1265
1365
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>[]
1366
+ - *Default:* CodeBuild, Lambda and Fargate runners with all the defaults (no VPC or default account VPC)
1367
+
1368
+ List of runner providers to use.
1369
+
1370
+ At least one provider is required. Provider will be selected when its label matches the labels requested by the workflow job.
1266
1371
 
1267
1372
  ---
1268
1373
 
@@ -1422,6 +1527,8 @@ VPC to launch the runners in.
1422
1527
 
1423
1528
  ### RunnerProviderProps <a name="RunnerProviderProps" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps"></a>
1424
1529
 
1530
+ Common properties for all runner providers.
1531
+
1425
1532
  #### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.RunnerProviderProps.Initializer"></a>
1426
1533
 
1427
1534
  ```typescript
@@ -1471,6 +1578,14 @@ Version of GitHub Runners to install.
1471
1578
 
1472
1579
  ### RunnerRuntimeParameters <a name="RunnerRuntimeParameters" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters"></a>
1473
1580
 
1581
+ Workflow job parameters as parsed from the webhook event. Pass these into your runner executor and run something like:.
1582
+
1583
+ ```sh
1584
+ ./config.sh --unattended --url "https://${GITHUB_DOMAIN}/${OWNER}/${REPO}" --token "${RUNNER_TOKEN}" --ephemeral --work _work --labels "${RUNNER_LABEL}" --name "${RUNNER_NAME}" --disableupdate
1585
+ ```
1586
+
1587
+ All parameters are specified as step function paths and therefore must be used only in step function task parameters.
1588
+
1474
1589
  #### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.Initializer"></a>
1475
1590
 
1476
1591
  ```typescript
@@ -1483,11 +1598,11 @@ const runnerRuntimeParameters: RunnerRuntimeParameters = { ... }
1483
1598
 
1484
1599
  | **Name** | **Type** | **Description** |
1485
1600
  | --- | --- | --- |
1486
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.githubDomainPath">githubDomainPath</a></code> | <code>string</code> | *No description.* |
1487
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.ownerPath">ownerPath</a></code> | <code>string</code> | *No description.* |
1488
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.repoPath">repoPath</a></code> | <code>string</code> | *No description.* |
1489
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerNamePath">runnerNamePath</a></code> | <code>string</code> | *No description.* |
1490
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerTokenPath">runnerTokenPath</a></code> | <code>string</code> | *No description.* |
1601
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.githubDomainPath">githubDomainPath</a></code> | <code>string</code> | Path to GitHub domain. |
1602
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.ownerPath">ownerPath</a></code> | <code>string</code> | Path to repostiroy owner name. |
1603
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.repoPath">repoPath</a></code> | <code>string</code> | Path to repository name. |
1604
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerNamePath">runnerNamePath</a></code> | <code>string</code> | Path to desired runner name. |
1605
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerTokenPath">runnerTokenPath</a></code> | <code>string</code> | Path to runner token used to register token. |
1491
1606
 
1492
1607
  ---
1493
1608
 
@@ -1499,6 +1614,10 @@ public readonly githubDomainPath: string;
1499
1614
 
1500
1615
  - *Type:* string
1501
1616
 
1617
+ Path to GitHub domain.
1618
+
1619
+ Most of the time this will be github.com but for self-hosted GitHub instances, this will be different.
1620
+
1502
1621
  ---
1503
1622
 
1504
1623
  ##### `ownerPath`<sup>Required</sup> <a name="ownerPath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.ownerPath"></a>
@@ -1509,6 +1628,8 @@ public readonly ownerPath: string;
1509
1628
 
1510
1629
  - *Type:* string
1511
1630
 
1631
+ Path to repostiroy owner name.
1632
+
1512
1633
  ---
1513
1634
 
1514
1635
  ##### `repoPath`<sup>Required</sup> <a name="repoPath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.repoPath"></a>
@@ -1519,6 +1640,8 @@ public readonly repoPath: string;
1519
1640
 
1520
1641
  - *Type:* string
1521
1642
 
1643
+ Path to repository name.
1644
+
1522
1645
  ---
1523
1646
 
1524
1647
  ##### `runnerNamePath`<sup>Required</sup> <a name="runnerNamePath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerNamePath"></a>
@@ -1529,6 +1652,10 @@ public readonly runnerNamePath: string;
1529
1652
 
1530
1653
  - *Type:* string
1531
1654
 
1655
+ Path to desired runner name.
1656
+
1657
+ We specifically set the name to make troubleshooting easier.
1658
+
1532
1659
  ---
1533
1660
 
1534
1661
  ##### `runnerTokenPath`<sup>Required</sup> <a name="runnerTokenPath" id="@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters.property.runnerTokenPath"></a>
@@ -1539,12 +1666,16 @@ public readonly runnerTokenPath: string;
1539
1666
 
1540
1667
  - *Type:* string
1541
1668
 
1669
+ Path to runner token used to register token.
1670
+
1542
1671
  ---
1543
1672
 
1544
1673
  ## Classes <a name="Classes" id="Classes"></a>
1545
1674
 
1546
1675
  ### RunnerVersion <a name="RunnerVersion" id="@cloudsnorkel/cdk-github-runners.RunnerVersion"></a>
1547
1676
 
1677
+ Defines desired GitHub Actions runner version.
1678
+
1548
1679
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.RunnerVersion.Initializer"></a>
1549
1680
 
1550
1681
  ```typescript
@@ -1570,8 +1701,8 @@ new RunnerVersion(version: string)
1570
1701
 
1571
1702
  | **Name** | **Description** |
1572
1703
  | --- | --- |
1573
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion.latest">latest</a></code> | *No description.* |
1574
- | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion.specific">specific</a></code> | *No description.* |
1704
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion.latest">latest</a></code> | Use the latest version available at the time the runner provider image is built. |
1705
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.RunnerVersion.specific">specific</a></code> | Use a specific version. |
1575
1706
 
1576
1707
  ---
1577
1708
 
@@ -1583,6 +1714,8 @@ import { RunnerVersion } from '@cloudsnorkel/cdk-github-runners'
1583
1714
  RunnerVersion.latest()
1584
1715
  ```
1585
1716
 
1717
+ Use the latest version available at the time the runner provider image is built.
1718
+
1586
1719
  ##### `specific` <a name="specific" id="@cloudsnorkel/cdk-github-runners.RunnerVersion.specific"></a>
1587
1720
 
1588
1721
  ```typescript
@@ -1591,10 +1724,16 @@ import { RunnerVersion } from '@cloudsnorkel/cdk-github-runners'
1591
1724
  RunnerVersion.specific(version: string)
1592
1725
  ```
1593
1726
 
1727
+ Use a specific version.
1728
+
1729
+ > [https://github.com/actions/runner/releases](https://github.com/actions/runner/releases)
1730
+
1594
1731
  ###### `version`<sup>Required</sup> <a name="version" id="@cloudsnorkel/cdk-github-runners.RunnerVersion.specific.parameter.version"></a>
1595
1732
 
1596
1733
  - *Type:* string
1597
1734
 
1735
+ GitHub Runner version.
1736
+
1598
1737
  ---
1599
1738
 
1600
1739
  #### Properties <a name="Properties" id="Properties"></a>
@@ -1624,6 +1763,10 @@ public readonly version: string;
1624
1763
 
1625
1764
  - *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner">CodeBuildRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunner">FargateRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner">LambdaRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
1626
1765
 
1766
+ Interface for all runner providers.
1767
+
1768
+ Implementations create all required resources and return a step function task that starts those resources from {@link getStepFunctionTask}.
1769
+
1627
1770
  #### Methods <a name="Methods" id="Methods"></a>
1628
1771
 
1629
1772
  | **Name** | **Description** |
@@ -1640,6 +1783,8 @@ public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
1640
1783
 
1641
1784
  Generate step function tasks that execute the runner.
1642
1785
 
1786
+ Called by GithubRunners and shouldn't be called manually.
1787
+
1643
1788
  ###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.IRunnerProvider.getStepFunctionTask.parameter.parameters"></a>
1644
1789
 
1645
1790
  - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>