@cloudsnorkel/cdk-github-runners 0.9.2 → 0.9.4

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.
Files changed (109) hide show
  1. package/.gitattributes +10 -9
  2. package/.jsii +871 -200
  3. package/API.md +567 -3
  4. package/assets/{lambdas/delete-runner.lambda → delete-runner.lambda}/index.js +96 -56
  5. package/assets/{lambdas → providers}/build-image.lambda/index.js +3 -3
  6. package/assets/{lambdas → providers/image-builders/aws-image-builder}/delete-ami.lambda/index.js +3 -3
  7. package/assets/providers/image-builders/aws-image-builder/filter-failed-builds.lambda/index.js +39 -0
  8. package/assets/{lambdas/aws-image-builder-versioner.lambda → providers/image-builders/aws-image-builder/versioner.lambda}/index.js +98 -58
  9. package/assets/{lambdas → providers}/update-lambda.lambda/index.js +1 -1
  10. package/assets/{lambdas/setup.lambda → setup.lambda}/index.js +4 -4
  11. package/assets/{lambdas/status.lambda → status.lambda}/index.js +96 -56
  12. package/assets/{lambdas/token-retriever.lambda → token-retriever.lambda}/index.js +96 -56
  13. package/assets/{lambdas/webhook-handler.lambda → webhook-handler.lambda}/index.js +3 -3
  14. package/lib/access.js +1 -1
  15. package/lib/{lambdas/delete-runner-function.d.ts → delete-runner-function.d.ts} +1 -1
  16. package/lib/delete-runner-function.js +23 -0
  17. package/lib/delete-runner.lambda.js +69 -0
  18. package/lib/github.js +50 -0
  19. package/lib/lambda-helpers.js +66 -0
  20. package/lib/{lambdas → providers}/build-image-function.d.ts +1 -1
  21. package/lib/providers/build-image-function.js +23 -0
  22. package/lib/providers/build-image.lambda.js +92 -0
  23. package/lib/providers/codebuild.js +2 -2
  24. package/lib/providers/common.js +3 -3
  25. package/lib/providers/ec2.js +2 -2
  26. package/lib/providers/ecs.js +10 -2
  27. package/lib/providers/fargate.js +2 -2
  28. package/lib/providers/image-builders/api.js +1 -1
  29. package/lib/providers/image-builders/aws-image-builder/builder.d.ts +12 -3
  30. package/lib/providers/image-builders/aws-image-builder/builder.js +43 -11
  31. package/lib/providers/image-builders/aws-image-builder/common.js +3 -3
  32. package/lib/{lambdas → providers/image-builders/aws-image-builder}/delete-ami-function.d.ts +1 -1
  33. package/lib/providers/image-builders/aws-image-builder/delete-ami-function.js +23 -0
  34. package/lib/providers/image-builders/aws-image-builder/delete-ami.lambda.js +87 -0
  35. package/lib/providers/image-builders/aws-image-builder/deprecated/ami.d.ts +0 -1
  36. package/lib/providers/image-builders/aws-image-builder/deprecated/ami.js +6 -5
  37. package/lib/providers/image-builders/aws-image-builder/deprecated/common.js +6 -1
  38. package/lib/providers/image-builders/aws-image-builder/deprecated/container.js +3 -3
  39. package/lib/providers/image-builders/aws-image-builder/deprecated/linux-components.js +2 -10
  40. package/lib/providers/image-builders/aws-image-builder/deprecated/windows-components.js +3 -16
  41. package/lib/providers/image-builders/aws-image-builder/filter-failed-builds-function.d.ts +13 -0
  42. package/lib/providers/image-builders/aws-image-builder/filter-failed-builds-function.js +23 -0
  43. package/lib/providers/image-builders/aws-image-builder/filter-failed-builds.lambda.js +18 -0
  44. package/lib/providers/image-builders/aws-image-builder/versioner-function.d.ts +13 -0
  45. package/lib/providers/image-builders/aws-image-builder/versioner-function.js +23 -0
  46. package/lib/providers/image-builders/aws-image-builder/versioner.lambda.js +96 -0
  47. package/lib/providers/image-builders/codebuild-deprecated.js +3 -3
  48. package/lib/providers/image-builders/codebuild.d.ts +11 -2
  49. package/lib/providers/image-builders/codebuild.js +19 -3
  50. package/lib/providers/image-builders/components.js +1 -1
  51. package/lib/providers/image-builders/static.js +1 -1
  52. package/lib/providers/index.d.ts +1 -0
  53. package/lib/providers/index.js +2 -1
  54. package/lib/providers/lambda.js +4 -4
  55. package/lib/{lambdas → providers}/update-lambda-function.d.ts +1 -1
  56. package/lib/providers/update-lambda-function.js +23 -0
  57. package/lib/providers/update-lambda.lambda.js +34 -0
  58. package/lib/runner.d.ts +9 -1
  59. package/lib/runner.js +24 -12
  60. package/lib/secrets.js +1 -1
  61. package/lib/{lambdas/setup-function.d.ts → setup-function.d.ts} +1 -1
  62. package/lib/setup-function.js +23 -0
  63. package/lib/setup.lambda.js +152 -0
  64. package/lib/{lambdas/status-function.d.ts → status-function.d.ts} +1 -1
  65. package/lib/status-function.js +23 -0
  66. package/lib/status.lambda.js +298 -0
  67. package/lib/{lambdas/token-retriever-function.d.ts → token-retriever-function.d.ts} +1 -1
  68. package/lib/token-retriever-function.js +23 -0
  69. package/lib/token-retriever.lambda.js +15 -0
  70. package/lib/{lambdas/webhook-handler-function.d.ts → webhook-handler-function.d.ts} +1 -1
  71. package/lib/webhook-handler-function.js +23 -0
  72. package/lib/webhook-handler.lambda.d.ts +1 -0
  73. package/lib/webhook-handler.lambda.js +116 -0
  74. package/lib/webhook.d.ts +1 -1
  75. package/lib/webhook.js +2 -2
  76. package/package.json +28 -26
  77. package/lib/lambdas/aws-image-builder-versioner-function.d.ts +0 -13
  78. package/lib/lambdas/aws-image-builder-versioner-function.js +0 -23
  79. package/lib/lambdas/aws-image-builder-versioner.lambda.js +0 -96
  80. package/lib/lambdas/build-image-function.js +0 -23
  81. package/lib/lambdas/build-image.lambda.js +0 -92
  82. package/lib/lambdas/delete-ami-function.js +0 -23
  83. package/lib/lambdas/delete-ami.lambda.js +0 -87
  84. package/lib/lambdas/delete-runner-function.js +0 -23
  85. package/lib/lambdas/delete-runner.lambda.js +0 -69
  86. package/lib/lambdas/github.js +0 -50
  87. package/lib/lambdas/helpers.js +0 -66
  88. package/lib/lambdas/setup-function.js +0 -23
  89. package/lib/lambdas/setup.lambda.js +0 -152
  90. package/lib/lambdas/status-function.js +0 -23
  91. package/lib/lambdas/status.lambda.js +0 -298
  92. package/lib/lambdas/token-retriever-function.js +0 -23
  93. package/lib/lambdas/token-retriever.lambda.js +0 -15
  94. package/lib/lambdas/update-lambda-function.js +0 -23
  95. package/lib/lambdas/update-lambda.lambda.js +0 -34
  96. package/lib/lambdas/webhook-handler-function.js +0 -23
  97. package/lib/lambdas/webhook-handler.lambda.js +0 -116
  98. /package/assets/{lambdas/setup.lambda → setup.lambda}/index.html +0 -0
  99. /package/lib/{lambdas/delete-runner.lambda.d.ts → delete-runner.lambda.d.ts} +0 -0
  100. /package/lib/{lambdas/github.d.ts → github.d.ts} +0 -0
  101. /package/lib/{lambdas/helpers.d.ts → lambda-helpers.d.ts} +0 -0
  102. /package/lib/{lambdas → providers}/build-image.lambda.d.ts +0 -0
  103. /package/lib/{lambdas → providers/image-builders/aws-image-builder}/delete-ami.lambda.d.ts +0 -0
  104. /package/lib/{lambdas/setup.lambda.d.ts → providers/image-builders/aws-image-builder/filter-failed-builds.lambda.d.ts} +0 -0
  105. /package/lib/{lambdas/aws-image-builder-versioner.lambda.d.ts → providers/image-builders/aws-image-builder/versioner.lambda.d.ts} +0 -0
  106. /package/lib/{lambdas → providers}/update-lambda.lambda.d.ts +0 -0
  107. /package/lib/{lambdas/status.lambda.d.ts → setup.lambda.d.ts} +0 -0
  108. /package/lib/{lambdas/token-retriever.lambda.d.ts → status.lambda.d.ts} +0 -0
  109. /package/lib/{lambdas/webhook-handler.lambda.d.ts → token-retriever.lambda.d.ts} +0 -0
package/API.md CHANGED
@@ -26,7 +26,6 @@ builder.addComponent(new ImageBuilderComponent(scope, id, {
26
26
  displayName: 'p7zip',
27
27
  description: 'Install some more packages',
28
28
  commands: [
29
- 'set -ex',
30
29
  'apt-get install p7zip',
31
30
  ],
32
31
  }));
@@ -1934,6 +1933,261 @@ Note that this is not the job log, but the runner itself. It will not contain ou
1934
1933
  ---
1935
1934
 
1936
1935
 
1936
+ ### EcsRunnerProvider <a name="EcsRunnerProvider" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider"></a>
1937
+
1938
+ - *Implements:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
1939
+
1940
+ GitHub Actions runner provider using ECS on EC2 to execute jobs.
1941
+
1942
+ ECS can be useful when you want more control of the infrastructure running the GitHub Actions Docker containers. You can control the autoscaling
1943
+ group to scale down to zero during the night and scale up during work hours. This way you can still save money, but have to wait less for
1944
+ infrastructure to spin up.
1945
+
1946
+ This construct is not meant to be used by itself. It should be passed in the providers property for GitHubRunners.
1947
+
1948
+ #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer"></a>
1949
+
1950
+ ```typescript
1951
+ import { EcsRunnerProvider } from '@cloudsnorkel/cdk-github-runners'
1952
+
1953
+ new EcsRunnerProvider(scope: Construct, id: string, props?: EcsRunnerProviderProps)
1954
+ ```
1955
+
1956
+ | **Name** | **Type** | **Description** |
1957
+ | --- | --- | --- |
1958
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
1959
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
1960
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.props">props</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps">EcsRunnerProviderProps</a></code> | *No description.* |
1961
+
1962
+ ---
1963
+
1964
+ ##### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.scope"></a>
1965
+
1966
+ - *Type:* constructs.Construct
1967
+
1968
+ ---
1969
+
1970
+ ##### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.id"></a>
1971
+
1972
+ - *Type:* string
1973
+
1974
+ ---
1975
+
1976
+ ##### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.Initializer.parameter.props"></a>
1977
+
1978
+ - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps">EcsRunnerProviderProps</a>
1979
+
1980
+ ---
1981
+
1982
+ #### Methods <a name="Methods" id="Methods"></a>
1983
+
1984
+ | **Name** | **Description** |
1985
+ | --- | --- |
1986
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.toString">toString</a></code> | Returns a string representation of this construct. |
1987
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.getStepFunctionTask">getStepFunctionTask</a></code> | Generate step function task(s) to start a new runner. |
1988
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.grantStateMachine">grantStateMachine</a></code> | An optional method that modifies the role of the state machine after all the tasks have been generated. |
1989
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.status">status</a></code> | Return status of the runner provider to be used in the main status function. |
1990
+
1991
+ ---
1992
+
1993
+ ##### `toString` <a name="toString" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.toString"></a>
1994
+
1995
+ ```typescript
1996
+ public toString(): string
1997
+ ```
1998
+
1999
+ Returns a string representation of this construct.
2000
+
2001
+ ##### `getStepFunctionTask` <a name="getStepFunctionTask" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.getStepFunctionTask"></a>
2002
+
2003
+ ```typescript
2004
+ public getStepFunctionTask(parameters: RunnerRuntimeParameters): IChainable
2005
+ ```
2006
+
2007
+ Generate step function task(s) to start a new runner.
2008
+
2009
+ Called by GithubRunners and shouldn't be called manually.
2010
+
2011
+ ###### `parameters`<sup>Required</sup> <a name="parameters" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.getStepFunctionTask.parameter.parameters"></a>
2012
+
2013
+ - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerRuntimeParameters">RunnerRuntimeParameters</a>
2014
+
2015
+ workflow job details.
2016
+
2017
+ ---
2018
+
2019
+ ##### `grantStateMachine` <a name="grantStateMachine" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.grantStateMachine"></a>
2020
+
2021
+ ```typescript
2022
+ public grantStateMachine(_: IGrantable): void
2023
+ ```
2024
+
2025
+ An optional method that modifies the role of the state machine after all the tasks have been generated.
2026
+
2027
+ This can be used to add additional policy
2028
+ statements to the state machine role that are not automatically added by the task returned from {@link getStepFunctionTask}.
2029
+
2030
+ ###### `_`<sup>Required</sup> <a name="_" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.grantStateMachine.parameter._"></a>
2031
+
2032
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
2033
+
2034
+ ---
2035
+
2036
+ ##### `status` <a name="status" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.status"></a>
2037
+
2038
+ ```typescript
2039
+ public status(statusFunctionRole: IGrantable): IRunnerProviderStatus
2040
+ ```
2041
+
2042
+ Return status of the runner provider to be used in the main status function.
2043
+
2044
+ Also gives the status function any needed permissions to query the Docker image or AMI.
2045
+
2046
+ ###### `statusFunctionRole`<sup>Required</sup> <a name="statusFunctionRole" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.status.parameter.statusFunctionRole"></a>
2047
+
2048
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
2049
+
2050
+ ---
2051
+
2052
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
2053
+
2054
+ | **Name** | **Description** |
2055
+ | --- | --- |
2056
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
2057
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder">imageBuilder</a></code> | Create new image builder that builds ECS specific runner images using Ubuntu. |
2058
+
2059
+ ---
2060
+
2061
+ ##### ~~`isConstruct`~~ <a name="isConstruct" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.isConstruct"></a>
2062
+
2063
+ ```typescript
2064
+ import { EcsRunnerProvider } from '@cloudsnorkel/cdk-github-runners'
2065
+
2066
+ EcsRunnerProvider.isConstruct(x: any)
2067
+ ```
2068
+
2069
+ Checks if `x` is a construct.
2070
+
2071
+ ###### `x`<sup>Required</sup> <a name="x" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.isConstruct.parameter.x"></a>
2072
+
2073
+ - *Type:* any
2074
+
2075
+ Any object.
2076
+
2077
+ ---
2078
+
2079
+ ##### `imageBuilder` <a name="imageBuilder" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder"></a>
2080
+
2081
+ ```typescript
2082
+ import { EcsRunnerProvider } from '@cloudsnorkel/cdk-github-runners'
2083
+
2084
+ EcsRunnerProvider.imageBuilder(scope: Construct, id: string, props?: RunnerImageBuilderProps)
2085
+ ```
2086
+
2087
+ Create new image builder that builds ECS specific runner images using Ubuntu.
2088
+
2089
+ Included components:
2090
+ * `RunnerImageComponent.requiredPackages()`
2091
+ * `RunnerImageComponent.runnerUser()`
2092
+ * `RunnerImageComponent.git()`
2093
+ * `RunnerImageComponent.githubCli()`
2094
+ * `RunnerImageComponent.awsCli()`
2095
+ * `RunnerImageComponent.dockerInDocker()`
2096
+ * `RunnerImageComponent.githubRunner()`
2097
+
2098
+ ###### `scope`<sup>Required</sup> <a name="scope" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder.parameter.scope"></a>
2099
+
2100
+ - *Type:* constructs.Construct
2101
+
2102
+ ---
2103
+
2104
+ ###### `id`<sup>Required</sup> <a name="id" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder.parameter.id"></a>
2105
+
2106
+ - *Type:* string
2107
+
2108
+ ---
2109
+
2110
+ ###### `props`<sup>Optional</sup> <a name="props" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.imageBuilder.parameter.props"></a>
2111
+
2112
+ - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.RunnerImageBuilderProps">RunnerImageBuilderProps</a>
2113
+
2114
+ ---
2115
+
2116
+ #### Properties <a name="Properties" id="Properties"></a>
2117
+
2118
+ | **Name** | **Type** | **Description** |
2119
+ | --- | --- | --- |
2120
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
2121
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.connections">connections</a></code> | <code>aws-cdk-lib.aws_ec2.Connections</code> | The network connections associated with this resource. |
2122
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Grant principal used to add permissions to the runner role. |
2123
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.labels">labels</a></code> | <code>string[]</code> | Labels associated with this provider. |
2124
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.logGroup">logGroup</a></code> | <code>aws-cdk-lib.aws_logs.ILogGroup</code> | Log group where provided runners will save their logs. |
2125
+
2126
+ ---
2127
+
2128
+ ##### `node`<sup>Required</sup> <a name="node" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.node"></a>
2129
+
2130
+ ```typescript
2131
+ public readonly node: Node;
2132
+ ```
2133
+
2134
+ - *Type:* constructs.Node
2135
+
2136
+ The tree node.
2137
+
2138
+ ---
2139
+
2140
+ ##### `connections`<sup>Required</sup> <a name="connections" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.connections"></a>
2141
+
2142
+ ```typescript
2143
+ public readonly connections: Connections;
2144
+ ```
2145
+
2146
+ - *Type:* aws-cdk-lib.aws_ec2.Connections
2147
+
2148
+ The network connections associated with this resource.
2149
+
2150
+ ---
2151
+
2152
+ ##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.grantPrincipal"></a>
2153
+
2154
+ ```typescript
2155
+ public readonly grantPrincipal: IPrincipal;
2156
+ ```
2157
+
2158
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
2159
+
2160
+ Grant principal used to add permissions to the runner role.
2161
+
2162
+ ---
2163
+
2164
+ ##### `labels`<sup>Required</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.labels"></a>
2165
+
2166
+ ```typescript
2167
+ public readonly labels: string[];
2168
+ ```
2169
+
2170
+ - *Type:* string[]
2171
+
2172
+ Labels associated with this provider.
2173
+
2174
+ ---
2175
+
2176
+ ##### `logGroup`<sup>Required</sup> <a name="logGroup" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProvider.property.logGroup"></a>
2177
+
2178
+ ```typescript
2179
+ public readonly logGroup: ILogGroup;
2180
+ ```
2181
+
2182
+ - *Type:* aws-cdk-lib.aws_logs.ILogGroup
2183
+
2184
+ Log group where provided runners will save their logs.
2185
+
2186
+ Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution.
2187
+
2188
+ ---
2189
+
2190
+
1937
2191
  ### FargateRunner <a name="FargateRunner" id="@cloudsnorkel/cdk-github-runners.FargateRunner"></a>
1938
2192
 
1939
2193
  #### Initializers <a name="Initializers" id="@cloudsnorkel/cdk-github-runners.FargateRunner.Initializer"></a>
@@ -2846,6 +3100,7 @@ new GitHubRunners(scope: Construct, id: string, props?: GitHubRunnersProps)
2846
3100
  | **Name** | **Description** |
2847
3101
  | --- | --- |
2848
3102
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.toString">toString</a></code> | Returns a string representation of this construct. |
3103
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.failedImageBuildsTopic">failedImageBuildsTopic</a></code> | Creates a topic for notifications when a runner image build fails. |
2849
3104
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed">metricFailed</a></code> | Metric for failed runner executions. |
2850
3105
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricJobCompleted">metricJobCompleted</a></code> | Metric for the number of GitHub Actions jobs completed. |
2851
3106
  | <code><a href="#@cloudsnorkel/cdk-github-runners.GitHubRunners.metricSucceeded">metricSucceeded</a></code> | Metric for successful executions. |
@@ -2861,6 +3116,18 @@ public toString(): string
2861
3116
 
2862
3117
  Returns a string representation of this construct.
2863
3118
 
3119
+ ##### `failedImageBuildsTopic` <a name="failedImageBuildsTopic" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.failedImageBuildsTopic"></a>
3120
+
3121
+ ```typescript
3122
+ public failedImageBuildsTopic(): Topic
3123
+ ```
3124
+
3125
+ Creates a topic for notifications when a runner image build fails.
3126
+
3127
+ Runner images are rebuilt every week by default. This provides the latest GitHub Runner version and software updates.
3128
+
3129
+ If you want to be sure you are using the latest runner version, you can use this topic to be notified when a build fails.
3130
+
2864
3131
  ##### `metricFailed` <a name="metricFailed" id="@cloudsnorkel/cdk-github-runners.GitHubRunners.metricFailed"></a>
2865
3132
 
2866
3133
  ```typescript
@@ -3027,7 +3294,6 @@ new ImageBuilderComponent(this, 'AWS CLI', {
3027
3294
  displayName: 'AWS CLI',
3028
3295
  description: 'Install latest version of AWS CLI',
3029
3296
  commands: [
3030
- '$ErrorActionPreference = \'Stop\'',
3031
3297
  'Start-Process msiexec.exe -Wait -ArgumentList \'/i https://awscli.amazonaws.com/AWSCLIV2.msi /qn\'',
3032
3298
  ],
3033
3299
  }
@@ -5580,6 +5846,304 @@ VPC where runner instances will be launched.
5580
5846
 
5581
5847
  ---
5582
5848
 
5849
+ ### EcsRunnerProviderProps <a name="EcsRunnerProviderProps" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps"></a>
5850
+
5851
+ Properties for EcsRunnerProvider.
5852
+
5853
+ #### Initializer <a name="Initializer" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.Initializer"></a>
5854
+
5855
+ ```typescript
5856
+ import { EcsRunnerProviderProps } from '@cloudsnorkel/cdk-github-runners'
5857
+
5858
+ const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... }
5859
+ ```
5860
+
5861
+ #### Properties <a name="Properties" id="Properties"></a>
5862
+
5863
+ | **Name** | **Type** | **Description** |
5864
+ | --- | --- | --- |
5865
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.logRetention">logRetention</a></code> | <code>aws-cdk-lib.aws_logs.RetentionDays</code> | The number of days log events are kept in CloudWatch Logs. |
5866
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.retryOptions">retryOptions</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a></code> | Options to retry operation in case of failure like missing capacity, or API quota issues. |
5867
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.assignPublicIp">assignPublicIp</a></code> | <code>boolean</code> | Assign public IP to the runner task. |
5868
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.capacityProvider">capacityProvider</a></code> | <code>aws-cdk-lib.aws_ecs.AsgCapacityProvider</code> | Existing capacity provider to use. |
5869
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.cluster">cluster</a></code> | <code>aws-cdk-lib.aws_ecs.Cluster</code> | Existing ECS cluster to use. |
5870
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.cpu">cpu</a></code> | <code>number</code> | The number of cpu units used by the task. |
5871
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.dockerInDocker">dockerInDocker</a></code> | <code>boolean</code> | Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode. |
5872
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.imageBuilder">imageBuilder</a></code> | <code><a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageBuilder">IRunnerImageBuilder</a></code> | Runner image builder used to build Docker images containing GitHub Runner and all requirements. |
5873
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.instanceType">instanceType</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceType</code> | Instance type of ECS cluster instances. |
5874
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.labels">labels</a></code> | <code>string[]</code> | GitHub Actions labels used for this provider. |
5875
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.maxInstances">maxInstances</a></code> | <code>number</code> | The maximum number of instances to run in the cluster. |
5876
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.memoryLimitMiB">memoryLimitMiB</a></code> | <code>number</code> | The amount (in MiB) of memory used by the task. |
5877
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.minInstances">minInstances</a></code> | <code>number</code> | The minimum number of instances to run in the cluster. |
5878
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.securityGroups">securityGroups</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup[]</code> | Security groups to assign to the task. |
5879
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spotMaxPrice">spotMaxPrice</a></code> | <code>string</code> | Use spot capacity and set a maximum price for spot instances. |
5880
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.storageSize">storageSize</a></code> | <code>aws-cdk-lib.Size</code> | Size of volume available for launched cluster instances. |
5881
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.subnetSelection">subnetSelection</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | Subnets to run the runners in. |
5882
+ | <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC to launch the runners in. |
5883
+
5884
+ ---
5885
+
5886
+ ##### `logRetention`<sup>Optional</sup> <a name="logRetention" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.logRetention"></a>
5887
+
5888
+ ```typescript
5889
+ public readonly logRetention: RetentionDays;
5890
+ ```
5891
+
5892
+ - *Type:* aws-cdk-lib.aws_logs.RetentionDays
5893
+ - *Default:* logs.RetentionDays.ONE_MONTH
5894
+
5895
+ The number of days log events are kept in CloudWatch Logs.
5896
+
5897
+ When updating
5898
+ this property, unsetting it doesn't remove the log retention policy. To
5899
+ remove the retention policy, set the value to `INFINITE`.
5900
+
5901
+ ---
5902
+
5903
+ ##### `retryOptions`<sup>Optional</sup> <a name="retryOptions" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.retryOptions"></a>
5904
+
5905
+ ```typescript
5906
+ public readonly retryOptions: ProviderRetryOptions;
5907
+ ```
5908
+
5909
+ - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.ProviderRetryOptions">ProviderRetryOptions</a>
5910
+ - *Default:* retry 10 times up to about 45 minutes
5911
+
5912
+ Options to retry operation in case of failure like missing capacity, or API quota issues.
5913
+
5914
+ ---
5915
+
5916
+ ##### `assignPublicIp`<sup>Optional</sup> <a name="assignPublicIp" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.assignPublicIp"></a>
5917
+
5918
+ ```typescript
5919
+ public readonly assignPublicIp: boolean;
5920
+ ```
5921
+
5922
+ - *Type:* boolean
5923
+ - *Default:* true
5924
+
5925
+ Assign public IP to the runner task.
5926
+
5927
+ Make sure the task will have access to GitHub. A public IP might be required unless you have NAT gateway.
5928
+
5929
+ ---
5930
+
5931
+ ##### `capacityProvider`<sup>Optional</sup> <a name="capacityProvider" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.capacityProvider"></a>
5932
+
5933
+ ```typescript
5934
+ public readonly capacityProvider: AsgCapacityProvider;
5935
+ ```
5936
+
5937
+ - *Type:* aws-cdk-lib.aws_ecs.AsgCapacityProvider
5938
+ - *Default:* new capacity provider
5939
+
5940
+ Existing capacity provider to use.
5941
+
5942
+ ---
5943
+
5944
+ ##### `cluster`<sup>Optional</sup> <a name="cluster" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.cluster"></a>
5945
+
5946
+ ```typescript
5947
+ public readonly cluster: Cluster;
5948
+ ```
5949
+
5950
+ - *Type:* aws-cdk-lib.aws_ecs.Cluster
5951
+ - *Default:* a new cluster
5952
+
5953
+ Existing ECS cluster to use.
5954
+
5955
+ ---
5956
+
5957
+ ##### `cpu`<sup>Optional</sup> <a name="cpu" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.cpu"></a>
5958
+
5959
+ ```typescript
5960
+ public readonly cpu: number;
5961
+ ```
5962
+
5963
+ - *Type:* number
5964
+ - *Default:* 1024
5965
+
5966
+ The number of cpu units used by the task.
5967
+
5968
+ 1024 units is 1 vCPU. Fractions of a vCPU are supported.
5969
+
5970
+ ---
5971
+
5972
+ ##### `dockerInDocker`<sup>Optional</sup> <a name="dockerInDocker" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.dockerInDocker"></a>
5973
+
5974
+ ```typescript
5975
+ public readonly dockerInDocker: boolean;
5976
+ ```
5977
+
5978
+ - *Type:* boolean
5979
+ - *Default:* true
5980
+
5981
+ Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode.
5982
+
5983
+ Disabling this can
5984
+ speed up provisioning of CodeBuild runners. If you don't intend on running or building Docker images, disable this for faster start-up times.
5985
+
5986
+ ---
5987
+
5988
+ ##### `imageBuilder`<sup>Optional</sup> <a name="imageBuilder" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.imageBuilder"></a>
5989
+
5990
+ ```typescript
5991
+ public readonly imageBuilder: IRunnerImageBuilder;
5992
+ ```
5993
+
5994
+ - *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageBuilder">IRunnerImageBuilder</a>
5995
+ - *Default:* EcsRunnerProvider.imageBuilder()
5996
+
5997
+ Runner image builder used to build Docker images containing GitHub Runner and all requirements.
5998
+
5999
+ The image builder determines the OS and architecture of the runner.
6000
+
6001
+ ---
6002
+
6003
+ ##### `instanceType`<sup>Optional</sup> <a name="instanceType" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.instanceType"></a>
6004
+
6005
+ ```typescript
6006
+ public readonly instanceType: InstanceType;
6007
+ ```
6008
+
6009
+ - *Type:* aws-cdk-lib.aws_ec2.InstanceType
6010
+ - *Default:* m5.large or m6g.large
6011
+
6012
+ Instance type of ECS cluster instances.
6013
+
6014
+ Only used when creating a new cluster.
6015
+
6016
+ ---
6017
+
6018
+ ##### `labels`<sup>Optional</sup> <a name="labels" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.labels"></a>
6019
+
6020
+ ```typescript
6021
+ public readonly labels: string[];
6022
+ ```
6023
+
6024
+ - *Type:* string[]
6025
+ - *Default:* ['ecs']
6026
+
6027
+ GitHub Actions labels used for this provider.
6028
+
6029
+ These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for
6030
+ based on runs-on. We match the labels from the webhook with the labels specified here. If all the labels specified here are present in the
6031
+ job's labels, this provider will be chosen and spawn a new runner.
6032
+
6033
+ ---
6034
+
6035
+ ##### `maxInstances`<sup>Optional</sup> <a name="maxInstances" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.maxInstances"></a>
6036
+
6037
+ ```typescript
6038
+ public readonly maxInstances: number;
6039
+ ```
6040
+
6041
+ - *Type:* number
6042
+ - *Default:* 5
6043
+
6044
+ The maximum number of instances to run in the cluster.
6045
+
6046
+ Only used when creating a new cluster.
6047
+
6048
+ ---
6049
+
6050
+ ##### `memoryLimitMiB`<sup>Optional</sup> <a name="memoryLimitMiB" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.memoryLimitMiB"></a>
6051
+
6052
+ ```typescript
6053
+ public readonly memoryLimitMiB: number;
6054
+ ```
6055
+
6056
+ - *Type:* number
6057
+ - *Default:* 3500
6058
+
6059
+ The amount (in MiB) of memory used by the task.
6060
+
6061
+ ---
6062
+
6063
+ ##### `minInstances`<sup>Optional</sup> <a name="minInstances" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.minInstances"></a>
6064
+
6065
+ ```typescript
6066
+ public readonly minInstances: number;
6067
+ ```
6068
+
6069
+ - *Type:* number
6070
+ - *Default:* 0
6071
+
6072
+ The minimum number of instances to run in the cluster.
6073
+
6074
+ Only used when creating a new cluster.
6075
+
6076
+ ---
6077
+
6078
+ ##### `securityGroups`<sup>Optional</sup> <a name="securityGroups" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.securityGroups"></a>
6079
+
6080
+ ```typescript
6081
+ public readonly securityGroups: ISecurityGroup[];
6082
+ ```
6083
+
6084
+ - *Type:* aws-cdk-lib.aws_ec2.ISecurityGroup[]
6085
+ - *Default:* a new security group
6086
+
6087
+ Security groups to assign to the task.
6088
+
6089
+ ---
6090
+
6091
+ ##### `spotMaxPrice`<sup>Optional</sup> <a name="spotMaxPrice" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spotMaxPrice"></a>
6092
+
6093
+ ```typescript
6094
+ public readonly spotMaxPrice: string;
6095
+ ```
6096
+
6097
+ - *Type:* string
6098
+ - *Default:* no spot capacity
6099
+
6100
+ Use spot capacity and set a maximum price for spot instances.
6101
+
6102
+ ---
6103
+
6104
+ ##### `storageSize`<sup>Optional</sup> <a name="storageSize" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.storageSize"></a>
6105
+
6106
+ ```typescript
6107
+ public readonly storageSize: Size;
6108
+ ```
6109
+
6110
+ - *Type:* aws-cdk-lib.Size
6111
+ - *Default:* default size for AMI (usually 30GB for Linux and 50GB for Windows)
6112
+
6113
+ Size of volume available for launched cluster instances.
6114
+
6115
+ This modifies the boot volume size and doesn't add any additional volumes.
6116
+
6117
+ Each instance can be used by multiple runners, so make sure there is enough space for all of them.
6118
+
6119
+ ---
6120
+
6121
+ ##### `subnetSelection`<sup>Optional</sup> <a name="subnetSelection" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.subnetSelection"></a>
6122
+
6123
+ ```typescript
6124
+ public readonly subnetSelection: SubnetSelection;
6125
+ ```
6126
+
6127
+ - *Type:* aws-cdk-lib.aws_ec2.SubnetSelection
6128
+ - *Default:* ECS default
6129
+
6130
+ Subnets to run the runners in.
6131
+
6132
+ ---
6133
+
6134
+ ##### `vpc`<sup>Optional</sup> <a name="vpc" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.vpc"></a>
6135
+
6136
+ ```typescript
6137
+ public readonly vpc: IVpc;
6138
+ ```
6139
+
6140
+ - *Type:* aws-cdk-lib.aws_ec2.IVpc
6141
+ - *Default:* default account VPC
6142
+
6143
+ VPC to launch the runners in.
6144
+
6145
+ ---
6146
+
5583
6147
  ### FargateRunnerProviderProps <a name="FargateRunnerProviderProps" id="@cloudsnorkel/cdk-github-runners.FargateRunnerProviderProps"></a>
5584
6148
 
5585
6149
  Properties for FargateRunnerProvider.
@@ -8705,7 +9269,7 @@ Log group name for the image builder where history of image builds can be analyz
8705
9269
 
8706
9270
  - *Extends:* aws-cdk-lib.aws_ec2.IConnectable, aws-cdk-lib.aws_iam.IGrantable, constructs.IConstruct
8707
9271
 
8708
- - *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner">CodeBuildRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProvider">CodeBuildRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner">Ec2Runner</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProvider">Ec2RunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunner">FargateRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProvider">FargateRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner">LambdaRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProvider">LambdaRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
9272
+ - *Implemented By:* <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunner">CodeBuildRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProvider">CodeBuildRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2Runner">Ec2Runner</a>, <a href="#@cloudsnorkel/cdk-github-runners.Ec2RunnerProvider">Ec2RunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProvider">EcsRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunner">FargateRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.FargateRunnerProvider">FargateRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunner">LambdaRunner</a>, <a href="#@cloudsnorkel/cdk-github-runners.LambdaRunnerProvider">LambdaRunnerProvider</a>, <a href="#@cloudsnorkel/cdk-github-runners.IRunnerProvider">IRunnerProvider</a>
8709
9273
 
8710
9274
  Interface for all runner providers.
8711
9275