Skip to content

Commit 4391437

Browse files
committed
Merge branch 'renovate/all' of https://github.com/cattle-ops/terraform-aws-gitlab-runner into renovate/all
2 parents 67075f0 + ad55110 commit 4391437

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

docker_autoscaler.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "aws_launch_template" "this" {
1010
count = var.runner_worker.type == "docker-autoscaler" ? 1 : 0
1111

1212
name = "${local.name_runner_agent_instance}-worker-launch-template"
13-
user_data = base64gzip(var.runner_worker_docker_autoscaler_instance.start_script)
13+
user_data = var.runner_worker_docker_autoscaler_instance.start_script_compression_algorithm == "gzip" ? base64gzip(var.runner_worker_docker_autoscaler_instance.start_script) : base64encode(var.runner_worker_docker_autoscaler_instance.start_script)
1414
image_id = length(var.runner_worker_docker_autoscaler_ami_id) > 0 ? var.runner_worker_docker_autoscaler_ami_id : data.aws_ami.docker_autoscaler_by_filter[0].id
1515
instance_type = length(var.runner_worker_docker_autoscaler_asg.types) > 0 ? var.runner_worker_docker_autoscaler_asg.types[0] : var.runner_worker_docker_autoscaler_asg.default_instance_type
1616
key_name = aws_key_pair.autoscaler[0].key_name

variables.tf

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ variable "runner_worker_docker_autoscaler_instance" {
769769
root_device_name = The name of the root volume for the Runner Worker.
770770
root_size = The size of the root volume for the Runner Worker.
771771
start_script = Cloud-init user data that will be passed to the Runner Worker. Should not be base64 encrypted.
772+
start_script_compression_algorithm = `gzip` compress the start script to mitigate the ~16 KB user data limit. Use `none` for Windows (EC2Launch does not support gzipped user data).
772773
volume_type = The type of volume to use for the Runner Worker. `gp2`, `gp3`, `io1` or `io2` are supported.
773774
volume_iops = Guaranteed IOPS for the volume. Only supported when using `gp3`, `io1` or `io2` as `volume_type`.
774775
volume_throughput = Throughput in MB/s for the volume. Only supported when using `gp3` as `volume_type`.
@@ -777,18 +778,24 @@ EOT
777778
type = object({
778779
ebs_optimized = optional(bool, true)
779780
# TODO should always be "required", right? https://aquasecurity.github.io/tfsec/v1.28.0/checks/aws/ec2/enforce-launch-config-http-token-imds/
780-
http_tokens = optional(string, "required")
781-
http_put_response_hop_limit = optional(number, 2)
782-
monitoring = optional(bool, false)
783-
private_address_only = optional(bool, true)
784-
root_device_name = optional(string, "/dev/sda1")
785-
root_size = optional(number, 8)
786-
start_script = optional(string, "")
787-
volume_type = optional(string, "gp2")
788-
volume_throughput = optional(number, 125)
789-
volume_iops = optional(number, 3000)
781+
http_tokens = optional(string, "required")
782+
http_put_response_hop_limit = optional(number, 2)
783+
monitoring = optional(bool, false)
784+
private_address_only = optional(bool, true)
785+
root_device_name = optional(string, "/dev/sda1")
786+
root_size = optional(number, 8)
787+
start_script = optional(string, "")
788+
start_script_compression_algorithm = optional(string, "gzip")
789+
volume_type = optional(string, "gp2")
790+
volume_throughput = optional(number, 125)
791+
volume_iops = optional(number, 3000)
790792
})
791793
default = {}
794+
795+
validation {
796+
condition = contains(["gzip", "none"], var.runner_worker_docker_autoscaler_instance.start_script_compression_algorithm)
797+
error_message = "The start_script_compression_algorithm supports `gzip` or `none`"
798+
}
792799
}
793800

794801
variable "runner_worker_docker_autoscaler_asg" {

0 commit comments

Comments
 (0)