@rio-cloud/cdk-v2-constructs 6.2.1 → 6.2.2
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 +420 -1
- package/CHANGELOG.md +2 -0
- package/docs/API.md +621 -0
- package/lib/contributions/smart-route/gitlab-runner/autoscaling-runner.d.ts +10 -10
- package/lib/contributions/smart-route/gitlab-runner/autoscaling-runner.js +19 -10
- package/lib/contributions/smart-route/gitlab-runner/runner-roles.d.ts +1 -1
- package/lib/contributions/smart-route/gitlab-runner/runner-roles.js +31 -9
- package/lib/contributions/smart-route/gitlab-runner/spot-role.js +5 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/package.json +1 -1
- package/version.json +1 -1
package/docs/API.md
CHANGED
|
@@ -2487,6 +2487,158 @@ AWS resource type.
|
|
|
2487
2487
|
---
|
|
2488
2488
|
|
|
2489
2489
|
|
|
2490
|
+
### GitlabRunner <a name="GitlabRunner" id="@rio-cloud/cdk-v2-constructs.GitlabRunner"></a>
|
|
2491
|
+
|
|
2492
|
+
The construct create the GitLabRunner Manager instance which will autoscale Runner instances based on the configuration.
|
|
2493
|
+
|
|
2494
|
+
By default, the construct will create a Runner with a manager T3 Micro instance which will be enabled to spawn T3 Large Runner
|
|
2495
|
+
worker spot instance. The default runner Role has only the permissions to upload and download from the S3 runner cache.
|
|
2496
|
+
|
|
2497
|
+
minimal configuration with runner spot instance:
|
|
2498
|
+
```ts
|
|
2499
|
+
new SpotServiceLinkedRole(stack, 'SpotLinkedRole');
|
|
2500
|
+
new GitlabRunner(stack, 'GitLabRunner', {
|
|
2501
|
+
env: {account: '123456789012', region: 'eu-west-1'}
|
|
2502
|
+
});
|
|
2503
|
+
```
|
|
2504
|
+
recommended:
|
|
2505
|
+
```ts
|
|
2506
|
+
new SpotServiceLinkedRole(stack, 'SpotLinkedRole');
|
|
2507
|
+
const runnerRoles = new RunnerRoles(stack, 'RunnerRoles', {env: {account: '123456789012', region: 'eu-west-1'}});
|
|
2508
|
+
new GitlabRunner(stack, 'GitLabRunner', {
|
|
2509
|
+
env: {account: '123456789012', region: 'eu-west-1'},
|
|
2510
|
+
runnersWorkerProps: [
|
|
2511
|
+
{
|
|
2512
|
+
token: myTokenForTaggedRunner1, // with this runner we only want to run jobs that require more power
|
|
2513
|
+
gitInstanceUrl: 'https://gitlab.cicd.man', // or the Traton GitLab
|
|
2514
|
+
instanceType: InstanceType.of(InstanceClass.M7I_FLEX, InstanceSize.XLARGE), // exemplary larger runner
|
|
2515
|
+
spotPrice: 0.2, // exemplary spot price
|
|
2516
|
+
requestSpotPrice: true,
|
|
2517
|
+
defaultWorkerRole: runnerRoles.runnerBaseRole, // use the base role
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
token: myTokenForTaggedRunner2, // with this runner we want to run all generic jobs that do not require much processing power
|
|
2521
|
+
gitInstanceUrl: 'https://gitlab.cicd.man', // or the Traton GitLab
|
|
2522
|
+
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MEDIUM), // exemplary smaller runner
|
|
2523
|
+
spotPrice: 0.044, // exemplary spot price
|
|
2524
|
+
requestSpotPrice: true,
|
|
2525
|
+
defaultWorkerRole: runnerRoles.runnerBaseRole, // use the base role
|
|
2526
|
+
},
|
|
2527
|
+
],
|
|
2528
|
+
});
|
|
2529
|
+
```
|
|
2530
|
+
|
|
2531
|
+
#### Initializers <a name="Initializers" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer"></a>
|
|
2532
|
+
|
|
2533
|
+
```typescript
|
|
2534
|
+
import { GitlabRunner } from '@rio-cloud/cdk-v2-constructs'
|
|
2535
|
+
|
|
2536
|
+
new GitlabRunner(scope: Stack, id: string, props: GitLabRunnerProps)
|
|
2537
|
+
```
|
|
2538
|
+
|
|
2539
|
+
| **Name** | **Type** | **Description** |
|
|
2540
|
+
| --- | --- | --- |
|
|
2541
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.scope">scope</a></code> | <code>aws-cdk-lib.Stack</code> | *No description.* |
|
|
2542
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
2543
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.props">props</a></code> | <code><a href="#@rio-cloud/cdk-v2-constructs.GitLabRunnerProps">GitLabRunnerProps</a></code> | *No description.* |
|
|
2544
|
+
|
|
2545
|
+
---
|
|
2546
|
+
|
|
2547
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.scope"></a>
|
|
2548
|
+
|
|
2549
|
+
- *Type:* aws-cdk-lib.Stack
|
|
2550
|
+
|
|
2551
|
+
---
|
|
2552
|
+
|
|
2553
|
+
##### `id`<sup>Required</sup> <a name="id" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.id"></a>
|
|
2554
|
+
|
|
2555
|
+
- *Type:* string
|
|
2556
|
+
|
|
2557
|
+
---
|
|
2558
|
+
|
|
2559
|
+
##### `props`<sup>Required</sup> <a name="props" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.Initializer.parameter.props"></a>
|
|
2560
|
+
|
|
2561
|
+
- *Type:* <a href="#@rio-cloud/cdk-v2-constructs.GitLabRunnerProps">GitLabRunnerProps</a>
|
|
2562
|
+
|
|
2563
|
+
---
|
|
2564
|
+
|
|
2565
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
2566
|
+
|
|
2567
|
+
| **Name** | **Description** |
|
|
2568
|
+
| --- | --- |
|
|
2569
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
2570
|
+
|
|
2571
|
+
---
|
|
2572
|
+
|
|
2573
|
+
##### `toString` <a name="toString" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.toString"></a>
|
|
2574
|
+
|
|
2575
|
+
```typescript
|
|
2576
|
+
public toString(): string
|
|
2577
|
+
```
|
|
2578
|
+
|
|
2579
|
+
Returns a string representation of this construct.
|
|
2580
|
+
|
|
2581
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
2582
|
+
|
|
2583
|
+
| **Name** | **Description** |
|
|
2584
|
+
| --- | --- |
|
|
2585
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
2586
|
+
|
|
2587
|
+
---
|
|
2588
|
+
|
|
2589
|
+
##### `isConstruct` <a name="isConstruct" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.isConstruct"></a>
|
|
2590
|
+
|
|
2591
|
+
```typescript
|
|
2592
|
+
import { GitlabRunner } from '@rio-cloud/cdk-v2-constructs'
|
|
2593
|
+
|
|
2594
|
+
GitlabRunner.isConstruct(x: any)
|
|
2595
|
+
```
|
|
2596
|
+
|
|
2597
|
+
Checks if `x` is a construct.
|
|
2598
|
+
|
|
2599
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
2600
|
+
instances, even when the construct library is symlinked.
|
|
2601
|
+
|
|
2602
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
2603
|
+
disk are seen as independent, completely different libraries. As a
|
|
2604
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
2605
|
+
is seen as a different class, and an instance of one class will not test as
|
|
2606
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
2607
|
+
like this, but users may manually symlink construct libraries together or
|
|
2608
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
2609
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
2610
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
2611
|
+
this type-testing method instead.
|
|
2612
|
+
|
|
2613
|
+
###### `x`<sup>Required</sup> <a name="x" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.isConstruct.parameter.x"></a>
|
|
2614
|
+
|
|
2615
|
+
- *Type:* any
|
|
2616
|
+
|
|
2617
|
+
Any object.
|
|
2618
|
+
|
|
2619
|
+
---
|
|
2620
|
+
|
|
2621
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
2622
|
+
|
|
2623
|
+
| **Name** | **Type** | **Description** |
|
|
2624
|
+
| --- | --- | --- |
|
|
2625
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunner.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
2626
|
+
|
|
2627
|
+
---
|
|
2628
|
+
|
|
2629
|
+
##### `node`<sup>Required</sup> <a name="node" id="@rio-cloud/cdk-v2-constructs.GitlabRunner.property.node"></a>
|
|
2630
|
+
|
|
2631
|
+
```typescript
|
|
2632
|
+
public readonly node: Node;
|
|
2633
|
+
```
|
|
2634
|
+
|
|
2635
|
+
- *Type:* constructs.Node
|
|
2636
|
+
|
|
2637
|
+
The tree node.
|
|
2638
|
+
|
|
2639
|
+
---
|
|
2640
|
+
|
|
2641
|
+
|
|
2490
2642
|
### KafkaEventSpec <a name="KafkaEventSpec" id="@rio-cloud/cdk-v2-constructs.KafkaEventSpec"></a>
|
|
2491
2643
|
|
|
2492
2644
|
Construct to provide an event specification for a Kafka topic and upload it to the central event store.
|
|
@@ -4745,6 +4897,248 @@ public readonly loadbalancer: ApplicationLoadBalancer;
|
|
|
4745
4897
|
---
|
|
4746
4898
|
|
|
4747
4899
|
|
|
4900
|
+
### RunnerRoles <a name="RunnerRoles" id="@rio-cloud/cdk-v2-constructs.RunnerRoles"></a>
|
|
4901
|
+
|
|
4902
|
+
This construct provides a set of base roles for gitlab runners in order to build, test, validate and deploy applications on RIO.
|
|
4903
|
+
|
|
4904
|
+
The roles need to be assumed during job runtime to perform more permissive actions, such as creating certificates to
|
|
4905
|
+
authenticate towards the RIO MSK, pushing docker images to ECR, performing a secrets backup, deploying stacks,
|
|
4906
|
+
or to publish an SPA to a S3 bucket. Do not assume the deployment role unless needed.
|
|
4907
|
+
The base role can be the default role attached to GitLab runners.
|
|
4908
|
+
The role allows to read various basic parameters such as the NIST data mirror, the OSS license bucket, DataDog keys
|
|
4909
|
+
and to pull ECR images form public Gallery or the specified account in the environment.
|
|
4910
|
+
The Role ARNs are export using CFNOutputs. Use the outputs to configure environment variables in your GitLab group.
|
|
4911
|
+
|
|
4912
|
+
#### Initializers <a name="Initializers" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer"></a>
|
|
4913
|
+
|
|
4914
|
+
```typescript
|
|
4915
|
+
import { RunnerRoles } from '@rio-cloud/cdk-v2-constructs'
|
|
4916
|
+
|
|
4917
|
+
new RunnerRoles(scope: Stack, id: string, props: RunnerRoleProps)
|
|
4918
|
+
```
|
|
4919
|
+
|
|
4920
|
+
| **Name** | **Type** | **Description** |
|
|
4921
|
+
| --- | --- | --- |
|
|
4922
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.scope">scope</a></code> | <code>aws-cdk-lib.Stack</code> | *No description.* |
|
|
4923
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
4924
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.props">props</a></code> | <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoleProps">RunnerRoleProps</a></code> | *No description.* |
|
|
4925
|
+
|
|
4926
|
+
---
|
|
4927
|
+
|
|
4928
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.scope"></a>
|
|
4929
|
+
|
|
4930
|
+
- *Type:* aws-cdk-lib.Stack
|
|
4931
|
+
|
|
4932
|
+
---
|
|
4933
|
+
|
|
4934
|
+
##### `id`<sup>Required</sup> <a name="id" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.id"></a>
|
|
4935
|
+
|
|
4936
|
+
- *Type:* string
|
|
4937
|
+
|
|
4938
|
+
---
|
|
4939
|
+
|
|
4940
|
+
##### `props`<sup>Required</sup> <a name="props" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.Initializer.parameter.props"></a>
|
|
4941
|
+
|
|
4942
|
+
- *Type:* <a href="#@rio-cloud/cdk-v2-constructs.RunnerRoleProps">RunnerRoleProps</a>
|
|
4943
|
+
|
|
4944
|
+
---
|
|
4945
|
+
|
|
4946
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
4947
|
+
|
|
4948
|
+
| **Name** | **Description** |
|
|
4949
|
+
| --- | --- |
|
|
4950
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
4951
|
+
|
|
4952
|
+
---
|
|
4953
|
+
|
|
4954
|
+
##### `toString` <a name="toString" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.toString"></a>
|
|
4955
|
+
|
|
4956
|
+
```typescript
|
|
4957
|
+
public toString(): string
|
|
4958
|
+
```
|
|
4959
|
+
|
|
4960
|
+
Returns a string representation of this construct.
|
|
4961
|
+
|
|
4962
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
4963
|
+
|
|
4964
|
+
| **Name** | **Description** |
|
|
4965
|
+
| --- | --- |
|
|
4966
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
4967
|
+
|
|
4968
|
+
---
|
|
4969
|
+
|
|
4970
|
+
##### `isConstruct` <a name="isConstruct" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.isConstruct"></a>
|
|
4971
|
+
|
|
4972
|
+
```typescript
|
|
4973
|
+
import { RunnerRoles } from '@rio-cloud/cdk-v2-constructs'
|
|
4974
|
+
|
|
4975
|
+
RunnerRoles.isConstruct(x: any)
|
|
4976
|
+
```
|
|
4977
|
+
|
|
4978
|
+
Checks if `x` is a construct.
|
|
4979
|
+
|
|
4980
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
4981
|
+
instances, even when the construct library is symlinked.
|
|
4982
|
+
|
|
4983
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
4984
|
+
disk are seen as independent, completely different libraries. As a
|
|
4985
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
4986
|
+
is seen as a different class, and an instance of one class will not test as
|
|
4987
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
4988
|
+
like this, but users may manually symlink construct libraries together or
|
|
4989
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
4990
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
4991
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
4992
|
+
this type-testing method instead.
|
|
4993
|
+
|
|
4994
|
+
###### `x`<sup>Required</sup> <a name="x" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.isConstruct.parameter.x"></a>
|
|
4995
|
+
|
|
4996
|
+
- *Type:* any
|
|
4997
|
+
|
|
4998
|
+
Any object.
|
|
4999
|
+
|
|
5000
|
+
---
|
|
5001
|
+
|
|
5002
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
5003
|
+
|
|
5004
|
+
| **Name** | **Type** | **Description** |
|
|
5005
|
+
| --- | --- | --- |
|
|
5006
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
5007
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoles.property.runnerBaseRole">runnerBaseRole</a></code> | <code>aws-cdk-lib.aws_iam.Role</code> | *No description.* |
|
|
5008
|
+
|
|
5009
|
+
---
|
|
5010
|
+
|
|
5011
|
+
##### `node`<sup>Required</sup> <a name="node" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.property.node"></a>
|
|
5012
|
+
|
|
5013
|
+
```typescript
|
|
5014
|
+
public readonly node: Node;
|
|
5015
|
+
```
|
|
5016
|
+
|
|
5017
|
+
- *Type:* constructs.Node
|
|
5018
|
+
|
|
5019
|
+
The tree node.
|
|
5020
|
+
|
|
5021
|
+
---
|
|
5022
|
+
|
|
5023
|
+
##### `runnerBaseRole`<sup>Required</sup> <a name="runnerBaseRole" id="@rio-cloud/cdk-v2-constructs.RunnerRoles.property.runnerBaseRole"></a>
|
|
5024
|
+
|
|
5025
|
+
```typescript
|
|
5026
|
+
public readonly runnerBaseRole: Role;
|
|
5027
|
+
```
|
|
5028
|
+
|
|
5029
|
+
- *Type:* aws-cdk-lib.aws_iam.Role
|
|
5030
|
+
|
|
5031
|
+
---
|
|
5032
|
+
|
|
5033
|
+
|
|
5034
|
+
### SpotServiceLinkedRole <a name="SpotServiceLinkedRole" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole"></a>
|
|
5035
|
+
|
|
5036
|
+
The construct creates a service linked role required to run GitLab Runners using Spot EC2 instances.
|
|
5037
|
+
|
|
5038
|
+
#### Initializers <a name="Initializers" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.Initializer"></a>
|
|
5039
|
+
|
|
5040
|
+
```typescript
|
|
5041
|
+
import { SpotServiceLinkedRole } from '@rio-cloud/cdk-v2-constructs'
|
|
5042
|
+
|
|
5043
|
+
new SpotServiceLinkedRole(scope: Construct, id: string)
|
|
5044
|
+
```
|
|
5045
|
+
|
|
5046
|
+
| **Name** | **Type** | **Description** |
|
|
5047
|
+
| --- | --- | --- |
|
|
5048
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
5049
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
5050
|
+
|
|
5051
|
+
---
|
|
5052
|
+
|
|
5053
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.Initializer.parameter.scope"></a>
|
|
5054
|
+
|
|
5055
|
+
- *Type:* constructs.Construct
|
|
5056
|
+
|
|
5057
|
+
---
|
|
5058
|
+
|
|
5059
|
+
##### `id`<sup>Required</sup> <a name="id" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.Initializer.parameter.id"></a>
|
|
5060
|
+
|
|
5061
|
+
- *Type:* string
|
|
5062
|
+
|
|
5063
|
+
---
|
|
5064
|
+
|
|
5065
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
5066
|
+
|
|
5067
|
+
| **Name** | **Description** |
|
|
5068
|
+
| --- | --- |
|
|
5069
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
5070
|
+
|
|
5071
|
+
---
|
|
5072
|
+
|
|
5073
|
+
##### `toString` <a name="toString" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.toString"></a>
|
|
5074
|
+
|
|
5075
|
+
```typescript
|
|
5076
|
+
public toString(): string
|
|
5077
|
+
```
|
|
5078
|
+
|
|
5079
|
+
Returns a string representation of this construct.
|
|
5080
|
+
|
|
5081
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
5082
|
+
|
|
5083
|
+
| **Name** | **Description** |
|
|
5084
|
+
| --- | --- |
|
|
5085
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
5086
|
+
|
|
5087
|
+
---
|
|
5088
|
+
|
|
5089
|
+
##### `isConstruct` <a name="isConstruct" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.isConstruct"></a>
|
|
5090
|
+
|
|
5091
|
+
```typescript
|
|
5092
|
+
import { SpotServiceLinkedRole } from '@rio-cloud/cdk-v2-constructs'
|
|
5093
|
+
|
|
5094
|
+
SpotServiceLinkedRole.isConstruct(x: any)
|
|
5095
|
+
```
|
|
5096
|
+
|
|
5097
|
+
Checks if `x` is a construct.
|
|
5098
|
+
|
|
5099
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
5100
|
+
instances, even when the construct library is symlinked.
|
|
5101
|
+
|
|
5102
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
5103
|
+
disk are seen as independent, completely different libraries. As a
|
|
5104
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
5105
|
+
is seen as a different class, and an instance of one class will not test as
|
|
5106
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
5107
|
+
like this, but users may manually symlink construct libraries together or
|
|
5108
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
5109
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
5110
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
5111
|
+
this type-testing method instead.
|
|
5112
|
+
|
|
5113
|
+
###### `x`<sup>Required</sup> <a name="x" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.isConstruct.parameter.x"></a>
|
|
5114
|
+
|
|
5115
|
+
- *Type:* any
|
|
5116
|
+
|
|
5117
|
+
Any object.
|
|
5118
|
+
|
|
5119
|
+
---
|
|
5120
|
+
|
|
5121
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
5122
|
+
|
|
5123
|
+
| **Name** | **Type** | **Description** |
|
|
5124
|
+
| --- | --- | --- |
|
|
5125
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
5126
|
+
|
|
5127
|
+
---
|
|
5128
|
+
|
|
5129
|
+
##### `node`<sup>Required</sup> <a name="node" id="@rio-cloud/cdk-v2-constructs.SpotServiceLinkedRole.property.node"></a>
|
|
5130
|
+
|
|
5131
|
+
```typescript
|
|
5132
|
+
public readonly node: Node;
|
|
5133
|
+
```
|
|
5134
|
+
|
|
5135
|
+
- *Type:* constructs.Node
|
|
5136
|
+
|
|
5137
|
+
The tree node.
|
|
5138
|
+
|
|
5139
|
+
---
|
|
5140
|
+
|
|
5141
|
+
|
|
4748
5142
|
### UpperToLower <a name="UpperToLower" id="@rio-cloud/cdk-v2-constructs.UpperToLower"></a>
|
|
4749
5143
|
|
|
4750
5144
|
#### Initializers <a name="Initializers" id="@rio-cloud/cdk-v2-constructs.UpperToLower.Initializer"></a>
|
|
@@ -9546,6 +9940,205 @@ The operating system that your task definitions are running on.
|
|
|
9546
9940
|
|
|
9547
9941
|
---
|
|
9548
9942
|
|
|
9943
|
+
### GitLabRunnerProps <a name="GitLabRunnerProps" id="@rio-cloud/cdk-v2-constructs.GitLabRunnerProps"></a>
|
|
9944
|
+
|
|
9945
|
+
The GitLabRunnerProps require the VPC ID, a defined environment of account and region, optional runner configuration and optionally the GitLab Runner Manager instance type.
|
|
9946
|
+
|
|
9947
|
+
By default, a T3 Micro instance will be used.
|
|
9948
|
+
For larger workloads and very active teams it is recommended to use T3 Small for the manager instead.
|
|
9949
|
+
|
|
9950
|
+
#### Initializer <a name="Initializer" id="@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.Initializer"></a>
|
|
9951
|
+
|
|
9952
|
+
```typescript
|
|
9953
|
+
import { GitLabRunnerProps } from '@rio-cloud/cdk-v2-constructs'
|
|
9954
|
+
|
|
9955
|
+
const gitLabRunnerProps: GitLabRunnerProps = { ... }
|
|
9956
|
+
```
|
|
9957
|
+
|
|
9958
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
9959
|
+
|
|
9960
|
+
| **Name** | **Type** | **Description** |
|
|
9961
|
+
| --- | --- | --- |
|
|
9962
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.env">env</a></code> | <code>aws-cdk-lib.Environment</code> | *No description.* |
|
|
9963
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.managerInstanceType">managerInstanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | *No description.* |
|
|
9964
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.runnersWorkerProps">runnersWorkerProps</a></code> | <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps">GitlabRunnerWorkerProps</a>[]</code> | *No description.* |
|
|
9965
|
+
|
|
9966
|
+
---
|
|
9967
|
+
|
|
9968
|
+
##### `env`<sup>Required</sup> <a name="env" id="@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.env"></a>
|
|
9969
|
+
|
|
9970
|
+
```typescript
|
|
9971
|
+
public readonly env: Environment;
|
|
9972
|
+
```
|
|
9973
|
+
|
|
9974
|
+
- *Type:* aws-cdk-lib.Environment
|
|
9975
|
+
|
|
9976
|
+
---
|
|
9977
|
+
|
|
9978
|
+
##### `managerInstanceType`<sup>Optional</sup> <a name="managerInstanceType" id="@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.managerInstanceType"></a>
|
|
9979
|
+
|
|
9980
|
+
```typescript
|
|
9981
|
+
public readonly managerInstanceType: InstanceType;
|
|
9982
|
+
```
|
|
9983
|
+
|
|
9984
|
+
- *Type:* aws-cdk-lib.aws_ec2.InstanceType
|
|
9985
|
+
|
|
9986
|
+
---
|
|
9987
|
+
|
|
9988
|
+
##### `runnersWorkerProps`<sup>Optional</sup> <a name="runnersWorkerProps" id="@rio-cloud/cdk-v2-constructs.GitLabRunnerProps.property.runnersWorkerProps"></a>
|
|
9989
|
+
|
|
9990
|
+
```typescript
|
|
9991
|
+
public readonly runnersWorkerProps: GitlabRunnerWorkerProps[];
|
|
9992
|
+
```
|
|
9993
|
+
|
|
9994
|
+
- *Type:* <a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps">GitlabRunnerWorkerProps</a>[]
|
|
9995
|
+
|
|
9996
|
+
---
|
|
9997
|
+
|
|
9998
|
+
### GitlabRunnerWorkerProps <a name="GitlabRunnerWorkerProps" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps"></a>
|
|
9999
|
+
|
|
10000
|
+
The GitlabRunnerWorkerProps interface provides a simplified GitLab Runner worker configuration requiring a token as an SSM parameter, one of the valid gitlab URLs, instance of you choice, the desired max spot price, whether to use spot instance or not and a default role.
|
|
10001
|
+
|
|
10002
|
+
It is recommended to use the RunnerRoles construct, and it's exposed default runner role.
|
|
10003
|
+
|
|
10004
|
+
#### Initializer <a name="Initializer" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.Initializer"></a>
|
|
10005
|
+
|
|
10006
|
+
```typescript
|
|
10007
|
+
import { GitlabRunnerWorkerProps } from '@rio-cloud/cdk-v2-constructs'
|
|
10008
|
+
|
|
10009
|
+
const gitlabRunnerWorkerProps: GitlabRunnerWorkerProps = { ... }
|
|
10010
|
+
```
|
|
10011
|
+
|
|
10012
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
10013
|
+
|
|
10014
|
+
| **Name** | **Type** | **Description** |
|
|
10015
|
+
| --- | --- | --- |
|
|
10016
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.defaultWorkerRole">defaultWorkerRole</a></code> | <code>aws-cdk-lib.aws_iam.IRole</code> | The default role for the runner worker when spawned. |
|
|
10017
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.gitInstanceUrl">gitInstanceUrl</a></code> | <code>string</code> | The GitLab instance URL, either https://gitlab.cicd.man or https://gitlab.collaborationlayer-traton.com. |
|
|
10018
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.instanceType">instanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | The instance type for the runner worker. |
|
|
10019
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.requestSpotPrice">requestSpotPrice</a></code> | <code>boolean</code> | Whether to use spot instance or not, Requires ServiceLinked Role for EC2 Spot to be deployed in the account. |
|
|
10020
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.spotPrice">spotPrice</a></code> | <code>number</code> | The desired max spot price. |
|
|
10021
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.token">token</a></code> | <code>aws-cdk-lib.aws_ssm.IStringParameter</code> | The SSM StringParameter with the registered runner token. |
|
|
10022
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxBuilds">maxBuilds</a></code> | <code>number</code> | The maximum number of builds for an instance before it has to be decommissioned. |
|
|
10023
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxIdleInstance">maxIdleInstance</a></code> | <code>number</code> | The maximum number of instances to keep idle for new incoming jobs. |
|
|
10024
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxIdleTime">maxIdleTime</a></code> | <code>number</code> | The maximum idle time seconds for an instance. |
|
|
10025
|
+
|
|
10026
|
+
---
|
|
10027
|
+
|
|
10028
|
+
##### `defaultWorkerRole`<sup>Required</sup> <a name="defaultWorkerRole" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.defaultWorkerRole"></a>
|
|
10029
|
+
|
|
10030
|
+
```typescript
|
|
10031
|
+
public readonly defaultWorkerRole: IRole;
|
|
10032
|
+
```
|
|
10033
|
+
|
|
10034
|
+
- *Type:* aws-cdk-lib.aws_iam.IRole
|
|
10035
|
+
|
|
10036
|
+
The default role for the runner worker when spawned.
|
|
10037
|
+
|
|
10038
|
+
---
|
|
10039
|
+
|
|
10040
|
+
##### `gitInstanceUrl`<sup>Required</sup> <a name="gitInstanceUrl" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.gitInstanceUrl"></a>
|
|
10041
|
+
|
|
10042
|
+
```typescript
|
|
10043
|
+
public readonly gitInstanceUrl: string;
|
|
10044
|
+
```
|
|
10045
|
+
|
|
10046
|
+
- *Type:* string
|
|
10047
|
+
|
|
10048
|
+
The GitLab instance URL, either https://gitlab.cicd.man or https://gitlab.collaborationlayer-traton.com.
|
|
10049
|
+
|
|
10050
|
+
---
|
|
10051
|
+
|
|
10052
|
+
##### `instanceType`<sup>Required</sup> <a name="instanceType" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.instanceType"></a>
|
|
10053
|
+
|
|
10054
|
+
```typescript
|
|
10055
|
+
public readonly instanceType: InstanceType;
|
|
10056
|
+
```
|
|
10057
|
+
|
|
10058
|
+
- *Type:* aws-cdk-lib.aws_ec2.InstanceType
|
|
10059
|
+
|
|
10060
|
+
The instance type for the runner worker.
|
|
10061
|
+
|
|
10062
|
+
---
|
|
10063
|
+
|
|
10064
|
+
##### `requestSpotPrice`<sup>Required</sup> <a name="requestSpotPrice" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.requestSpotPrice"></a>
|
|
10065
|
+
|
|
10066
|
+
```typescript
|
|
10067
|
+
public readonly requestSpotPrice: boolean;
|
|
10068
|
+
```
|
|
10069
|
+
|
|
10070
|
+
- *Type:* boolean
|
|
10071
|
+
|
|
10072
|
+
Whether to use spot instance or not, Requires ServiceLinked Role for EC2 Spot to be deployed in the account.
|
|
10073
|
+
|
|
10074
|
+
---
|
|
10075
|
+
|
|
10076
|
+
##### `spotPrice`<sup>Required</sup> <a name="spotPrice" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.spotPrice"></a>
|
|
10077
|
+
|
|
10078
|
+
```typescript
|
|
10079
|
+
public readonly spotPrice: number;
|
|
10080
|
+
```
|
|
10081
|
+
|
|
10082
|
+
- *Type:* number
|
|
10083
|
+
|
|
10084
|
+
The desired max spot price.
|
|
10085
|
+
|
|
10086
|
+
---
|
|
10087
|
+
|
|
10088
|
+
##### `token`<sup>Required</sup> <a name="token" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.token"></a>
|
|
10089
|
+
|
|
10090
|
+
```typescript
|
|
10091
|
+
public readonly token: IStringParameter;
|
|
10092
|
+
```
|
|
10093
|
+
|
|
10094
|
+
- *Type:* aws-cdk-lib.aws_ssm.IStringParameter
|
|
10095
|
+
|
|
10096
|
+
The SSM StringParameter with the registered runner token.
|
|
10097
|
+
|
|
10098
|
+
---
|
|
10099
|
+
|
|
10100
|
+
##### `maxBuilds`<sup>Optional</sup> <a name="maxBuilds" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxBuilds"></a>
|
|
10101
|
+
|
|
10102
|
+
```typescript
|
|
10103
|
+
public readonly maxBuilds: number;
|
|
10104
|
+
```
|
|
10105
|
+
|
|
10106
|
+
- *Type:* number
|
|
10107
|
+
|
|
10108
|
+
The maximum number of builds for an instance before it has to be decommissioned.
|
|
10109
|
+
|
|
10110
|
+
Default 10
|
|
10111
|
+
|
|
10112
|
+
---
|
|
10113
|
+
|
|
10114
|
+
##### `maxIdleInstance`<sup>Optional</sup> <a name="maxIdleInstance" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxIdleInstance"></a>
|
|
10115
|
+
|
|
10116
|
+
```typescript
|
|
10117
|
+
public readonly maxIdleInstance: number;
|
|
10118
|
+
```
|
|
10119
|
+
|
|
10120
|
+
- *Type:* number
|
|
10121
|
+
|
|
10122
|
+
The maximum number of instances to keep idle for new incoming jobs.
|
|
10123
|
+
|
|
10124
|
+
Default 5
|
|
10125
|
+
|
|
10126
|
+
---
|
|
10127
|
+
|
|
10128
|
+
##### `maxIdleTime`<sup>Optional</sup> <a name="maxIdleTime" id="@rio-cloud/cdk-v2-constructs.GitlabRunnerWorkerProps.property.maxIdleTime"></a>
|
|
10129
|
+
|
|
10130
|
+
```typescript
|
|
10131
|
+
public readonly maxIdleTime: number;
|
|
10132
|
+
```
|
|
10133
|
+
|
|
10134
|
+
- *Type:* number
|
|
10135
|
+
|
|
10136
|
+
The maximum idle time seconds for an instance.
|
|
10137
|
+
|
|
10138
|
+
Default 900 seconds
|
|
10139
|
+
|
|
10140
|
+
---
|
|
10141
|
+
|
|
9549
10142
|
### KafkaAclStatement <a name="KafkaAclStatement" id="@rio-cloud/cdk-v2-constructs.KafkaAclStatement"></a>
|
|
9550
10143
|
|
|
9551
10144
|
Read and write permissions for the topic.
|
|
@@ -12804,6 +13397,34 @@ Path to secrets file containing encrypted secrets.
|
|
|
12804
13397
|
|
|
12805
13398
|
---
|
|
12806
13399
|
|
|
13400
|
+
### RunnerRoleProps <a name="RunnerRoleProps" id="@rio-cloud/cdk-v2-constructs.RunnerRoleProps"></a>
|
|
13401
|
+
|
|
13402
|
+
#### Initializer <a name="Initializer" id="@rio-cloud/cdk-v2-constructs.RunnerRoleProps.Initializer"></a>
|
|
13403
|
+
|
|
13404
|
+
```typescript
|
|
13405
|
+
import { RunnerRoleProps } from '@rio-cloud/cdk-v2-constructs'
|
|
13406
|
+
|
|
13407
|
+
const runnerRoleProps: RunnerRoleProps = { ... }
|
|
13408
|
+
```
|
|
13409
|
+
|
|
13410
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
13411
|
+
|
|
13412
|
+
| **Name** | **Type** | **Description** |
|
|
13413
|
+
| --- | --- | --- |
|
|
13414
|
+
| <code><a href="#@rio-cloud/cdk-v2-constructs.RunnerRoleProps.property.env">env</a></code> | <code>aws-cdk-lib.Environment</code> | *No description.* |
|
|
13415
|
+
|
|
13416
|
+
---
|
|
13417
|
+
|
|
13418
|
+
##### `env`<sup>Required</sup> <a name="env" id="@rio-cloud/cdk-v2-constructs.RunnerRoleProps.property.env"></a>
|
|
13419
|
+
|
|
13420
|
+
```typescript
|
|
13421
|
+
public readonly env: Environment;
|
|
13422
|
+
```
|
|
13423
|
+
|
|
13424
|
+
- *Type:* aws-cdk-lib.Environment
|
|
13425
|
+
|
|
13426
|
+
---
|
|
13427
|
+
|
|
12807
13428
|
### ShouldOverrideThresholdProps <a name="ShouldOverrideThresholdProps" id="@rio-cloud/cdk-v2-constructs.ShouldOverrideThresholdProps"></a>
|
|
12808
13429
|
|
|
12809
13430
|
#### Initializer <a name="Initializer" id="@rio-cloud/cdk-v2-constructs.ShouldOverrideThresholdProps.Initializer"></a>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Environment, Stack } from 'aws-cdk-lib';
|
|
2
2
|
import { InstanceType } from 'aws-cdk-lib/aws-ec2';
|
|
3
3
|
import { IRole } from 'aws-cdk-lib/aws-iam';
|
|
4
|
-
import {
|
|
4
|
+
import { IStringParameter } from 'aws-cdk-lib/aws-ssm';
|
|
5
5
|
import { Construct } from 'constructs';
|
|
6
6
|
/**
|
|
7
7
|
* The GitLabRunnerProps require the VPC ID, a defined environment of account and region, optional
|
|
@@ -21,23 +21,23 @@ export interface GitLabRunnerProps {
|
|
|
21
21
|
*/
|
|
22
22
|
export interface GitlabRunnerWorkerProps {
|
|
23
23
|
/** The SSM StringParameter with the registered runner token */
|
|
24
|
-
token:
|
|
24
|
+
readonly token: IStringParameter;
|
|
25
25
|
/** The GitLab instance URL, either https://gitlab.cicd.man or https://gitlab.collaborationlayer-traton.com */
|
|
26
|
-
gitInstanceUrl: GitlabInstanceUrl;
|
|
26
|
+
readonly gitInstanceUrl: GitlabInstanceUrl;
|
|
27
27
|
/** The instance type for the runner worker */
|
|
28
|
-
instanceType: InstanceType;
|
|
28
|
+
readonly instanceType: InstanceType;
|
|
29
29
|
/** The desired max spot price */
|
|
30
|
-
spotPrice: number;
|
|
30
|
+
readonly spotPrice: number;
|
|
31
31
|
/** Whether to use spot instance or not, Requires ServiceLinked Role for EC2 Spot to be deployed in the account */
|
|
32
|
-
requestSpotPrice: boolean;
|
|
32
|
+
readonly requestSpotPrice: boolean;
|
|
33
33
|
/** The default role for the runner worker when spawned */
|
|
34
|
-
defaultWorkerRole: IRole;
|
|
34
|
+
readonly defaultWorkerRole: IRole;
|
|
35
35
|
/** The maximum number of builds for an instance before it has to be decommissioned. Default 10 */
|
|
36
|
-
maxBuilds?: number;
|
|
36
|
+
readonly maxBuilds?: number;
|
|
37
37
|
/** The maximum number of instances to keep idle for new incoming jobs. Default 5 */
|
|
38
|
-
maxIdleInstance?: number;
|
|
38
|
+
readonly maxIdleInstance?: number;
|
|
39
39
|
/** The maximum idle time seconds for an instance. Default 900 seconds */
|
|
40
|
-
maxIdleTime?: number;
|
|
40
|
+
readonly maxIdleTime?: number;
|
|
41
41
|
}
|
|
42
42
|
export type GitlabInstanceUrl = 'https://gitlab.cicd.man' | 'https://gitlab.collaborationlayer-traton.com';
|
|
43
43
|
/**
|