forked from cattle-ops/terraform-aws-gitlab-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
locals.tf
23 lines (19 loc) · 1.07 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
locals {
// Convert list to a string separated and prepend by a comma
docker_machine_options_string = format(
",%s",
join(",", formatlist("%q", var.docker_machine_options)),
)
// Ensure off peak is optional
runners_off_peak_periods_string = var.runners_off_peak_periods == "" ? "" : format("OffPeakPeriods = %s", var.runners_off_peak_periods)
// Ensure max builds is optional
runners_max_builds_string = var.runners_max_builds == 0 ? "" : format("MaxBuilds = %d", var.runners_max_builds)
// Define key for runner token for SSM
secure_parameter_store_runner_token_key = "${var.environment}-${var.secure_parameter_store_runner_token_key}"
// custom names for instances and security groups
name_runner_instance = var.overrides["name_runner_agent_instance"] == "" ? local.tags["Name"] : var.overrides["name_runner_agent_instance"]
name_sg = var.overrides["name_sg"] == "" ? local.tags["Name"] : var.overrides["name_sg"]
runners_additional_volumes = <<-EOT
%{~for volume in var.runners_additional_volumes~},"${volume}"%{endfor~}
EOT
}