Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 5eb27b0

Browse files
anjoslucLucas Santos Anjosnpalm
authored
feat(syncer): add option to disable runner syncer lambda trigger (#2986)
* feat: Adding option to disable lambda syncer trigger * feat: Adding option to disable lambda syncer trigger, fixing README.md replacement * feat: Adding option to disable lambda syncer trigger on multi-runner module * feat: Adding option to disable lambda syncer trigger on multi-runner module, fix README.md --------- Co-authored-by: Lucas Santos Anjos <[email protected]> Co-authored-by: Niek Palm <[email protected]>
1 parent 1b6f2e0 commit 5eb27b0

File tree

9 files changed

+33
-9
lines changed

9 files changed

+33
-9
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ We welcome any improvement to the standard module to make the default as secure
457457
| <a name="input_enable_cloudwatch_agent"></a> [enable\_cloudwatch\_agent](#input\_enable\_cloudwatch\_agent) | Enabling the cloudwatch agent on the ec2 runner instances, the runner contains default config. Configuration can be overridden via `cloudwatch_config`. | `bool` | `true` | no |
458458
| <a name="input_enable_enable_fifo_build_queue"></a> [enable\_enable\_fifo\_build\_queue](#input\_enable\_enable\_fifo\_build\_queue) | DEPCRECATED: Replaced by `enable_fifo_build_queue` / `fifo_build_queue`. | `string` | `null` | no |
459459
| <a name="input_enable_ephemeral_runners"></a> [enable\_ephemeral\_runners](#input\_enable\_ephemeral\_runners) | Enable ephemeral runners, runners will only be used once. | `bool` | `false` | no |
460+
| <a name="input_enable_event_rule_binaries_syncer"></a> [enable\_event\_rule\_binaries\_syncer](#input\_enable\_event\_rule\_binaries\_syncer) | Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution | `bool` | `true` | no |
460461
| <a name="input_enable_fifo_build_queue"></a> [enable\_fifo\_build\_queue](#input\_enable\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |
461462
| <a name="input_enable_job_queued_check"></a> [enable\_job\_queued\_check](#input\_enable\_job\_queued\_check) | Only scale if the job event received by the scale up lambda is is in the state queued. By default enabled for non ephemeral runners and disabled for ephemeral. Set this variable to overwrite the default behavior. | `bool` | `null` | no |
462463
| <a name="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group) | Enabling the default managed security group creation. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. | `bool` | `true` | no |

Diff for: main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ module "runner_binaries" {
300300
logging_retention_in_days = var.logging_retention_in_days
301301
logging_kms_key_id = var.logging_kms_key_id
302302

303+
enable_event_rule_binaries_syncer = var.enable_event_rule_binaries_syncer
303304
server_side_encryption_configuration = var.runner_binaries_s3_sse_configuration
304305

305306
role_path = var.role_path

Diff for: modules/multi-runner/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ module "multi-runner" {
120120
| <a name="input_aws_partition"></a> [aws\_partition](#input\_aws\_partition) | (optiona) partition in the arn namespace to use if not 'aws' | `string` | `"aws"` | no |
121121
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes |
122122
| <a name="input_cloudwatch_config"></a> [cloudwatch\_config](#input\_cloudwatch\_config) | (optional) Replaces the module default cloudwatch log config. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html for details. | `string` | `null` | no |
123+
| <a name="input_enable_event_rule_binaries_syncer"></a> [enable\_event\_rule\_binaries\_syncer](#input\_enable\_event\_rule\_binaries\_syncer) | Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution | `bool` | `true` | no |
123124
| <a name="input_enable_managed_runner_security_group"></a> [enable\_managed\_runner\_security\_group](#input\_enable\_managed\_runner\_security\_group) | Enabling the default managed security group creation. Unmanaged security groups can be specified via `runner_additional_security_group_ids`. | `bool` | `true` | no |
124125
| <a name="input_enable_workflow_job_events_queue"></a> [enable\_workflow\_job\_events\_queue](#input\_enable\_workflow\_job\_events\_queue) | Enabling this experimental feature will create a secondory sqs queue to wich a copy of the workflow\_job event will be delivered. | `bool` | `false` | no |
125126
| <a name="input_ghes_ssl_verify"></a> [ghes\_ssl\_verify](#input\_ghes\_ssl\_verify) | GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |

Diff for: modules/multi-runner/runner-binaries.tf

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ module "runner_binaries" {
99
runner_os = each.value.os_type
1010
runner_architecture = each.value.architecture
1111

12-
lambda_s3_bucket = var.lambda_s3_bucket
13-
syncer_lambda_s3_key = var.syncer_lambda_s3_key
14-
syncer_lambda_s3_object_version = var.syncer_lambda_s3_object_version
15-
lambda_runtime = var.lambda_runtime
16-
lambda_architecture = var.lambda_architecture
17-
lambda_zip = var.runner_binaries_syncer_lambda_zip
18-
lambda_timeout = var.runner_binaries_syncer_lambda_timeout
19-
logging_retention_in_days = var.logging_retention_in_days
20-
logging_kms_key_id = var.logging_kms_key_id
12+
lambda_s3_bucket = var.lambda_s3_bucket
13+
syncer_lambda_s3_key = var.syncer_lambda_s3_key
14+
syncer_lambda_s3_object_version = var.syncer_lambda_s3_object_version
15+
lambda_runtime = var.lambda_runtime
16+
lambda_architecture = var.lambda_architecture
17+
lambda_zip = var.runner_binaries_syncer_lambda_zip
18+
lambda_timeout = var.runner_binaries_syncer_lambda_timeout
19+
logging_retention_in_days = var.logging_retention_in_days
20+
logging_kms_key_id = var.logging_kms_key_id
21+
enable_event_rule_binaries_syncer = var.enable_event_rule_binaries_syncer
2122

2223
server_side_encryption_configuration = var.runner_binaries_s3_sse_configuration
2324

Diff for: modules/multi-runner/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ variable "syncer_lambda_s3_object_version" {
343343
default = null
344344
}
345345

346+
variable "enable_event_rule_binaries_syncer" {
347+
type = bool
348+
default = true
349+
description = "Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution"
350+
}
351+
346352
variable "queue_encryption" {
347353
description = "Configure how data on queues managed by the modules in ecrypted at REST. Options are encryped via SSE, non encrypted and via KMSS. By default encryptes via SSE is enabled. See for more details the Terraform `aws_sqs_queue` resource https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue."
348354
type = object({

Diff for: modules/runner-binaries-syncer/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ No modules.
8888
|------|-------------|------|---------|:--------:|
8989
| <a name="input_aws_partition"></a> [aws\_partition](#input\_aws\_partition) | (optional) partition for the base arn if not 'aws' | `string` | `"aws"` | no |
9090
| <a name="input_distribution_bucket_name"></a> [distribution\_bucket\_name](#input\_distribution\_bucket\_name) | Bucket for storing the action runner distribution. | `string` | n/a | yes |
91+
| <a name="input_enable_event_rule_binaries_syncer"></a> [enable\_event\_rule\_binaries\_syncer](#input\_enable\_event\_rule\_binaries\_syncer) | Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution | `bool` | `true` | no |
9192
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | `null` | no |
9293
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | AWS Lambda architecture. Lambda functions using Graviton processors ('arm64') tend to have better price/performance than 'x86\_64' functions. | `string` | `"arm64"` | no |
9394
| <a name="input_lambda_principals"></a> [lambda\_principals](#input\_lambda\_principals) | (Optional) add extra principals to the role created for execution of the lambda, e.g. for local testing. | <pre>list(object({<br> type = string<br> identifiers = list(string)<br> }))</pre> | `[]` | no |

Diff for: modules/runner-binaries-syncer/runner-binaries-syncer.tf

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ resource "aws_cloudwatch_event_rule" "syncer" {
121121
name = "${var.prefix}-syncer-rule"
122122
schedule_expression = var.lambda_schedule_expression
123123
tags = var.tags
124+
is_enabled = var.enable_event_rule_binaries_syncer
124125
}
125126

126127
resource "aws_cloudwatch_event_target" "syncer" {

Diff for: modules/runner-binaries-syncer/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ variable "s3_logging_bucket_prefix" {
5656
}
5757
}
5858

59+
variable "enable_event_rule_binaries_syncer" {
60+
type = bool
61+
default = true
62+
description = "Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution"
63+
}
64+
5965
variable "lambda_schedule_expression" {
6066
description = "Scheduler expression for action runner binary syncer."
6167
type = string

Diff for: variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,12 @@ variable "enable_runner_binaries_syncer" {
707707
default = true
708708
}
709709

710+
variable "enable_event_rule_binaries_syncer" {
711+
type = bool
712+
default = true
713+
description = "Option to disable EventBridge Lambda trigger for the binary syncer, useful to stop automatic updates of binary distribution"
714+
}
715+
710716
variable "queue_encryption" {
711717
description = "Configure how data on queues managed by the modules in ecrypted at REST. Options are encryped via SSE, non encrypted and via KMSS. By default encryptes via SSE is enabled. See for more details the Terraform `aws_sqs_queue` resource https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue."
712718
type = object({

0 commit comments

Comments
 (0)