@cloudsnorkel/cdk-github-runners 0.14.0 → 0.14.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 +70 -70
- package/API.md +3 -3
- package/README.md +52 -7
- package/assets/delete-failed-runner.lambda/index.js +44 -20
- package/assets/idle-runner-repear.lambda/index.js +44 -20
- package/assets/image-builders/aws-image-builder/delete-resources.lambda/index.js +209 -0
- package/assets/image-builders/aws-image-builder/versioner.lambda/index.js +28 -4
- package/assets/image-builders/build-image.lambda/index.js +0 -24
- package/assets/setup.lambda/index.js +16 -16
- package/assets/status.lambda/index.js +44 -20
- package/assets/token-retriever.lambda/index.js +44 -20
- package/assets/webhook-handler.lambda/index.js +44 -20
- package/lib/access.js +1 -1
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/ami.d.ts +8 -0
- package/lib/image-builders/aws-image-builder/ami.js +3 -1
- package/lib/image-builders/aws-image-builder/builder.d.ts +2 -0
- package/lib/image-builders/aws-image-builder/builder.js +108 -68
- package/lib/image-builders/aws-image-builder/common.js +1 -1
- package/lib/image-builders/aws-image-builder/container.d.ts +6 -0
- package/lib/image-builders/aws-image-builder/container.js +3 -1
- package/lib/image-builders/aws-image-builder/delete-resources-function.d.ts +13 -0
- package/lib/image-builders/aws-image-builder/delete-resources-function.js +23 -0
- package/lib/image-builders/aws-image-builder/delete-resources.lambda.d.ts +9 -0
- package/lib/image-builders/aws-image-builder/delete-resources.lambda.js +159 -0
- package/lib/image-builders/aws-image-builder/deprecated/ami.d.ts +2 -2
- package/lib/image-builders/aws-image-builder/deprecated/ami.js +18 -37
- package/lib/image-builders/aws-image-builder/deprecated/container.js +13 -35
- package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
- package/lib/image-builders/aws-image-builder/workflow.js +2 -1
- package/lib/image-builders/build-image.lambda.d.ts +1 -3
- package/lib/image-builders/build-image.lambda.js +1 -25
- package/lib/image-builders/codebuild-deprecated.js +3 -3
- package/lib/image-builders/codebuild.js +2 -2
- package/lib/image-builders/components.js +1 -1
- package/lib/image-builders/static.js +1 -1
- package/lib/providers/codebuild.js +2 -2
- package/lib/providers/common.js +3 -3
- package/lib/providers/ec2.js +2 -2
- package/lib/providers/ecs.js +1 -1
- package/lib/providers/fargate.js +2 -2
- package/lib/providers/lambda.js +2 -2
- package/lib/runner.js +1 -1
- package/lib/secrets.js +1 -1
- package/package.json +27 -26
- package/assets/image-builders/aws-image-builder/delete-ami.lambda/index.js +0 -129
- package/lib/image-builders/aws-image-builder/delete-ami-function.d.ts +0 -13
- package/lib/image-builders/aws-image-builder/delete-ami-function.js +0 -23
- package/lib/image-builders/aws-image-builder/delete-ami.lambda.d.ts +0 -2
- package/lib/image-builders/aws-image-builder/delete-ami.lambda.js +0 -70
package/API.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
An AMI builder that uses AWS Image Builder to build AMIs pre-baked with all the GitHub Actions runner requirements.
|
|
10
10
|
|
|
11
|
-
Builders can be used with {@link
|
|
11
|
+
Builders can be used with {@link Ec2RunnerProvider }.
|
|
12
12
|
|
|
13
13
|
Each builder re-runs automatically at a set interval to make sure the AMIs contain the latest versions of everything.
|
|
14
14
|
|
|
@@ -197,7 +197,7 @@ Any object.
|
|
|
197
197
|
|
|
198
198
|
##### ~~`node`~~<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.AmiBuilder.property.node"></a>
|
|
199
199
|
|
|
200
|
-
- *Deprecated:* use RunnerImageBuilder
|
|
200
|
+
- *Deprecated:* use RunnerImageBuilder, e.g. with Ec2RunnerProvider.imageBuilder()
|
|
201
201
|
|
|
202
202
|
```typescript
|
|
203
203
|
public readonly node: Node;
|
|
@@ -211,7 +211,7 @@ The tree node.
|
|
|
211
211
|
|
|
212
212
|
##### ~~`connections`~~<sup>Required</sup> <a name="connections" id="@cloudsnorkel/cdk-github-runners.AmiBuilder.property.connections"></a>
|
|
213
213
|
|
|
214
|
-
- *Deprecated:* use RunnerImageBuilder
|
|
214
|
+
- *Deprecated:* use RunnerImageBuilder, e.g. with Ec2RunnerProvider.imageBuilder()
|
|
215
215
|
|
|
216
216
|
```typescript
|
|
217
217
|
public readonly connections: Connections;
|
package/README.md
CHANGED
|
@@ -65,9 +65,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
65
65
|
```
|
|
66
66
|
### Use
|
|
67
67
|
```python
|
|
68
|
+
from aws_cdk import App, Stack
|
|
68
69
|
from cloudsnorkel.cdk_github_runners import GitHubRunners
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
app = App()
|
|
72
|
+
stack = Stack(app, "github-runners")
|
|
73
|
+
GitHubRunners(stack, "runners")
|
|
74
|
+
|
|
75
|
+
app.synth()
|
|
71
76
|
```
|
|
72
77
|
</details>
|
|
73
78
|
<details><summary>TypeScript or JavaScript</summary>
|
|
@@ -79,9 +84,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
79
84
|
```
|
|
80
85
|
### Use
|
|
81
86
|
```typescript
|
|
87
|
+
import { App, Stack } from 'aws-cdk-lib';
|
|
82
88
|
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners';
|
|
83
89
|
|
|
84
|
-
new
|
|
90
|
+
const app = new App();
|
|
91
|
+
const stack = new Stack(app, 'github-runners');
|
|
92
|
+
new GitHubRunners(stack, 'runners');
|
|
93
|
+
|
|
94
|
+
app.synth();
|
|
85
95
|
```
|
|
86
96
|
</details>
|
|
87
97
|
<details><summary>Java</summary>
|
|
@@ -96,9 +106,19 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
96
106
|
```
|
|
97
107
|
### Use
|
|
98
108
|
```java
|
|
109
|
+
import software.amazon.awscdk.App;
|
|
110
|
+
import software.amazon.awscdk.Stack;
|
|
99
111
|
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;
|
|
100
112
|
|
|
101
|
-
|
|
113
|
+
public class Example {
|
|
114
|
+
public static void main(String[] args){
|
|
115
|
+
App app = new App();
|
|
116
|
+
Stack stack = new Stack(app, "github-runners");
|
|
117
|
+
GitHubRunners.Builder.create(stack, "runners").build();
|
|
118
|
+
|
|
119
|
+
app.synth();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
102
122
|
```
|
|
103
123
|
</details>
|
|
104
124
|
<details><summary>Go</summary>
|
|
@@ -110,9 +130,21 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
110
130
|
```
|
|
111
131
|
### Use
|
|
112
132
|
```go
|
|
113
|
-
|
|
133
|
+
package main
|
|
134
|
+
|
|
135
|
+
import (
|
|
136
|
+
"github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
|
|
137
|
+
"github.com/aws/aws-cdk-go/awscdk/v2"
|
|
138
|
+
"github.com/aws/jsii-runtime-go"
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
func main() {
|
|
142
|
+
app := awscdk.NewApp(nil)
|
|
143
|
+
stack := awscdk.NewStack(app, jsii.String("github-runners"), &awscdk.StackProps{})
|
|
144
|
+
cloudsnorkelcdkgithubrunners.NewGitHubRunners(stack, jsii.String("runners"), &cloudsnorkelcdkgithubrunners.GitHubRunnersProps{})
|
|
114
145
|
|
|
115
|
-
|
|
146
|
+
app.Synth(nil)
|
|
147
|
+
}
|
|
116
148
|
```
|
|
117
149
|
</details>
|
|
118
150
|
<details><summary>.NET</summary>
|
|
@@ -124,9 +156,22 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
124
156
|
```
|
|
125
157
|
### Use
|
|
126
158
|
```csharp
|
|
159
|
+
using Amazon.CDK;
|
|
127
160
|
using CloudSnorkel;
|
|
128
161
|
|
|
129
|
-
|
|
162
|
+
namespace Example
|
|
163
|
+
{
|
|
164
|
+
sealed class Program
|
|
165
|
+
{
|
|
166
|
+
public static void Main(string[] args)
|
|
167
|
+
{
|
|
168
|
+
var app = new App();
|
|
169
|
+
var stack = new Stack(app, "github-runners");
|
|
170
|
+
new GitHubRunners(stack, "runners");
|
|
171
|
+
app.Synth();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
130
175
|
```
|
|
131
176
|
</details>
|
|
132
177
|
2. Use `GitHubRunners` construct in your code (starting with default arguments is fine)
|
|
@@ -311,7 +356,7 @@ If you use and love this project, please consider contributing.
|
|
|
311
356
|
|
|
312
357
|
|
|
313
358
|
[1]: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners
|
|
314
|
-
[2]: https://github.com/marketplace/actions/configure-aws-credentials-for-github-actions
|
|
359
|
+
[2]: https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
|
|
315
360
|
[3]: https://github.com/philips-labs/terraform-aws-github-runner
|
|
316
361
|
[4]: https://github.com/actions/actions-runner-controller
|
|
317
362
|
[5]: https://github.com/actions/runner
|