Skip to content

Commit ec8fe8b

Browse files
npalmstuartp44
andauthored
Apply suggestions from code review
Co-authored-by: Stuart Pearson <[email protected]>
1 parent 1d224e8 commit ec8fe8b

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To be able to support a number of use-cases, the module has quite a lot of confi
66

77
- Org vs Repo level. You can configure the module to connect the runners in GitHub on an org level and share the runners in your org, or set the runners on repo level and the module will install the runner to the repo. There can be multiple repos but runners are not shared between repos.
88
- Multi-Runner module. This modules allows you to create multiple runner configurations with a single webhook and single GitHub App to simplify deployment of different types of runners. Check the detailed module [documentation](modules/public/multi-runner.md) for more information or checkout the [multi-runner example](examples/multi-runner.md).
9-
- Webhook mode, the module can be deployed in the mode `direct` and `eventbridge` (Experimental). The `direct` mode is the default and will directly distribute to SQS for the scale-up lambda. The `eventbridge` mode will publish the event to an event bus with a target rule the events are sent to a dispatch lambda. The dispatch lambda will send the event to the SQS queue. The `eventbridge` mode is useful when you want to have more control over the events and potentially filter them. The `eventbridge` mode is disabled by default. We expect thhe `eventbridge` mode will be the future direction to build a data lake, build metrics, act on `workflow_job` job started events, etc.
9+
- Webhook mode, the module can be deployed in `direct` mode or `eventbridge` (Experimental) mode. The `direct` mode is the default and will directly distribute to SQS for the scale-up lambda. The `eventbridge` mode will publish the events to a eventbus, the rule then directs the received events to a dispatch lambda. The dispatch lambda will send the event to the SQS queue. The `eventbridge` mode is useful when you want to have more control over the events and potentially filter them. The `eventbridge` mode is disabled by default. An example of what the `eventbridge` mode could be used for is building a data lake, build metrics, act on `workflow_job` job started events, etc.
1010
- Linux vs Windows. You can configure the OS types linux and win. Linux will be used by default.
1111
- Re-use vs Ephemeral. By default runners are re-used, until detected idle. Once idle they will be removed from the pool. To improve security we are introducing ephemeral runners. Those runners are only used for one job. Ephemeral runners only work in combination with the workflow job event. For ephemeral runners the lambda requests a JIT (just in time) configuration via the GitHub API to register the runner. [JIT configuration](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-just-in-time-runners) is limited to ephemeral runners (and currently not supported by GHES). For non-ephemeral runners, a registration token is always requested. In both cases the configuration is made available to the instance via the same SSM parameter. To disable JIT configuration for ephemeral runners set `enable_jit_config` to `false`. We also suggest using a pre-build AMI to improve the start time of jobs for ephemeral runners.
1212
- Job retry (**Beta**). By default the scale-up lambda will discard the message when it is handled. Meaning in the ephemeral use-case an instance is created. The created runner will ask GitHub for a job, no guarantee it will run the job for which it was scaling. Result could be that with small system hick-up the job is keeping waiting for a runner. Enable a pool (org runners) is one option to avoid this problem. Another option is to enable the job retry function. Which will retry the job after a delay for a configured number of times.
@@ -261,7 +261,7 @@ Below an example of the the log messages created.
261261

262262
### EventBridge
263263

264-
The module can be deployed in the mode `eventbridge` (Experimental). The `eventbridge` mode will publish the event to an event bus with a target rule the events are sent to a dispatch lambda. The dispatch lambda will send the event to the SQS queue. The `eventbridge` mode is disabled by default. We expect thhe `eventbridge` mode will be the future direction to build a data lake, build metrics, acto on `workflow_job` job started events, etc.
264+
This module can be deployed in using the mode `eventbridge` (Experimental). The `eventbridge` mode will publish an event to a eventbus. Within the eventbus, there is a target rule set, sending events to the dispatch lambda. The `eventbridge` mode is disabled by default.
265265

266266
Example to use the EventBridge:
267267

examples/default/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module "runners" {
9797
# prefix GitHub runners with the environment name
9898
runner_name_prefix = "${local.environment}_"
9999

100-
# webhook supports to modes, either direct or via the eventbridge, uncommet to enable eventbridge
100+
# webhook supports two modes, either direct or via the eventbridge, uncomment to enable eventbridge
101101
# eventbridge = {
102102
# enable = true
103103
# # adjust the allow events to only allow specific events, like workflow_job

modules/multi-runner/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ variable "metrics" {
685685
}
686686

687687
variable "eventbridge" {
688-
description = "Enable the use of EventBridge by the module. By enable this feature events will be putted on the EventBridge bhy the webhook instead of directly dispatchting to queues for sacling."
688+
description = "Enable the use of EventBridge by the module. By enabling this feature events will be put on the EventBridge by the webhook instead of directly dispatching to queues for scaling."
689689
type = object({
690690
enable = optional(bool, false)
691691
accept_events = optional(list(string), [])

modules/webhook/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> This module is treated as internal module, breaking changes will not trigger a major release bump.
44
5-
Th module can be deployed in two modes. Direct messages, are delivered directly to the runner queues. EventBridge messages are delivered to an EventBridge bus and then dispatched to the runner queues.
5+
The module can be deployed in two modes. 'Direct' messages, are delivered directly to the runner queues. 'EventBridge' messages are delivered to an EventBridge bus and then dispatched to the runner queues.
66

77
## Lambda Function
88

modules/webhook/variables.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ variable "matcher_config_parameter_store_tier" {
213213

214214
variable "eventbridge" {
215215
description = <<EOF
216-
Enable the use of EventBridge by the module. By enable this feature events will be putted on the EventBridge bhy the
217-
webhook instead of directly dispatchting to queues for sacling.
216+
Enable the use of EventBridge by the module. By enabling this feature events will be put on the EventBridge by the webhook instead of directly dispatching to queues for scaling.
218217
219218
`enable`: Enable the EventBridge feature.
220219
`accept_events`: List can be used to only allow specific events to be putted on the EventBridge. By default all events, empty list will be be interpreted as all events.

variables.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,7 @@ variable "job_retry" {
948948

949949
variable "eventbridge" {
950950
description = <<EOF
951-
Enable the use of EventBridge by the module. By enable this feature events will be putted on the EventBridge bhy the
952-
webhook instead of directly dispatchting to queues for sacling.
951+
Enable the use of EventBridge by the module. By enabling this feature events will be put on the EventBridge by the webhook instead of directly dispatching to queues for scaling.
953952
954953
`enable`: Enable the EventBridge feature.
955954
`accept_events`: List can be used to only allow specific events to be putted on the EventBridge. By default all events, empty list will be be interpreted as all events.

0 commit comments

Comments
 (0)