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