Skip to content

Commit 19bdf5c

Browse files
authored
breaking: Remove deprecated resources (#387)
* Remove aws_zone variable. No longer in use. * Remove runners_off_peak_* variables * Remove enable_forced_updates variable
1 parent 69d7204 commit 19bdf5c

File tree

7 files changed

+9
-70
lines changed

7 files changed

+9
-70
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ terraform destroy
337337
| <a name="input_asg_delete_timeout"></a> [asg\_delete\_timeout](#input\_asg\_delete\_timeout) | Timeout when trying to delete the Runner ASG. | `string` | `"10m"` | no |
338338
| <a name="input_asg_max_instance_lifetime"></a> [asg\_max\_instance\_lifetime](#input\_asg\_max\_instance\_lifetime) | The seconds before an instance is refreshed in the ASG. | `number` | `null` | no |
339339
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | n/a | yes |
340-
| <a name="input_aws_zone"></a> [aws\_zone](#input\_aws\_zone) | Deprecated. Will be removed in the next major release. | `string` | `"a"` | no |
341340
| <a name="input_cache_bucket"></a> [cache\_bucket](#input\_cache\_bucket) | Configuration to control the creation of the cache bucket. By default the bucket will be created and used as shared cache. To use the same cache across multiple runners disable the creation of the cache and provide a policy and bucket name. See the public runner example for more details. | `map(any)` | <pre>{<br> "bucket": "",<br> "create": true,<br> "policy": ""<br>}</pre> | no |
342341
| <a name="input_cache_bucket_name_include_account_id"></a> [cache\_bucket\_name\_include\_account\_id](#input\_cache\_bucket\_name\_include\_account\_id) | Boolean to add current account ID to cache bucket name. | `bool` | `true` | no |
343342
| <a name="input_cache_bucket_prefix"></a> [cache\_bucket\_prefix](#input\_cache\_bucket\_prefix) | Prefix for s3 cache bucket name. | `string` | `""` | no |
@@ -359,7 +358,6 @@ terraform destroy
359358
| <a name="input_enable_cloudwatch_logging"></a> [enable\_cloudwatch\_logging](#input\_enable\_cloudwatch\_logging) | Boolean used to enable or disable the CloudWatch logging. | `bool` | `true` | no |
360359
| <a name="input_enable_docker_machine_ssm_access"></a> [enable\_docker\_machine\_ssm\_access](#input\_enable\_docker\_machine\_ssm\_access) | Add IAM policies to the docker-machine instances to connect via the Session Manager. | `bool` | `false` | no |
361360
| <a name="input_enable_eip"></a> [enable\_eip](#input\_enable\_eip) | Enable the assignment of an EIP to the gitlab runner instance | `bool` | `false` | no |
362-
| <a name="input_enable_forced_updates"></a> [enable\_forced\_updates](#input\_enable\_forced\_updates) | DEPRECATED! and is replaced by `enable_asg_recreation. Setting this variable to true will do the opposite as expected. For backward compatibility the variable will remain some releases. Old desription: Enable automatic redeployment of the Runner ASG when the Launch Configs change.` | `string` | `null` | no |
363361
| <a name="input_enable_gitlab_runner_ssh_access"></a> [enable\_gitlab\_runner\_ssh\_access](#input\_enable\_gitlab\_runner\_ssh\_access) | Enables SSH Access to the gitlab runner instance. | `bool` | `false` | no |
364362
| <a name="input_enable_kms"></a> [enable\_kms](#input\_enable\_kms) | Let the module manage a KMS key, logs will be encrypted via KMS. Be-aware of the costs of an custom key. | `bool` | `false` | no |
365363
| <a name="input_enable_manage_gitlab_token"></a> [enable\_manage\_gitlab\_token](#input\_enable\_manage\_gitlab\_token) | Boolean to enable the management of the GitLab token in SSM. If `true` the token will be stored in SSM, which means the SSM property is a terraform managed resource. If `false` the Gitlab token will be stored in the SSM by the user-data script during creation of the the instance. However the SSM parameter is not managed by terraform and will remain in SSM after a `terraform destroy`. | `bool` | `true` | no |
@@ -415,10 +413,6 @@ terraform destroy
415413
| <a name="input_runners_max_builds"></a> [runners\_max\_builds](#input\_runners\_max\_builds) | Max builds for each runner after which it will be removed, will be used in the runner config.toml. By default set to 0, no maxBuilds will be set in the configuration. | `number` | `0` | no |
416414
| <a name="input_runners_monitoring"></a> [runners\_monitoring](#input\_runners\_monitoring) | Enable detailed cloudwatch monitoring for spot instances. | `bool` | `false` | no |
417415
| <a name="input_runners_name"></a> [runners\_name](#input\_runners\_name) | Name of the runner, will be used in the runner config.toml. | `string` | n/a | yes |
418-
| <a name="input_runners_off_peak_idle_count"></a> [runners\_off\_peak\_idle\_count](#input\_runners\_off\_peak\_idle\_count) | Deprecated, please use `runners_machine_autoscaling`. Off peak idle count of the runners, will be used in the runner config.toml. | `number` | `-1` | no |
419-
| <a name="input_runners_off_peak_idle_time"></a> [runners\_off\_peak\_idle\_time](#input\_runners\_off\_peak\_idle\_time) | Deprecated, please use `runners_machine_autoscaling`. Off peak idle time of the runners, will be used in the runner config.toml. | `number` | `-1` | no |
420-
| <a name="input_runners_off_peak_periods"></a> [runners\_off\_peak\_periods](#input\_runners\_off\_peak\_periods) | Deprecated, please use `runners_machine_autoscaling`. Off peak periods of the runners, will be used in the runner config.toml. | `string` | `null` | no |
421-
| <a name="input_runners_off_peak_timezone"></a> [runners\_off\_peak\_timezone](#input\_runners\_off\_peak\_timezone) | Deprecated, please use `runners_machine_autoscaling`. Off peak idle time zone of the runners, will be used in the runner config.toml. | `string` | `null` | no |
422416
| <a name="input_runners_output_limit"></a> [runners\_output\_limit](#input\_runners\_output\_limit) | Sets the maximum build log size in kilobytes, by default set to 4096 (4MB) | `number` | `4096` | no |
423417
| <a name="input_runners_post_build_script"></a> [runners\_post\_build\_script](#input\_runners\_post\_build\_script) | Commands to be executed on the Runner just after executing the build, but before executing after\_script. | `string` | `"\"\""` | no |
424418
| <a name="input_runners_pre_build_script"></a> [runners\_pre\_build\_script](#input\_runners\_pre\_build\_script) | Script to execute in the pipeline just before the build, will be used in the runner config.toml | `string` | `"\"\""` | no |

examples/runner-default/main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ module "runner" {
7979
]
8080

8181
# working 9 to 5 :)
82-
# Deprecated, replaced by runners_machine_autoscaling
83-
# runners_off_peak_periods = "[\"* * 0-9,17-23 * * mon-fri *\", \"* * * * * sat,sun *\"]"
84-
# runners_off_peak_timezone = var.timezone
85-
# runners_off_peak_idle_count = 0
86-
# runners_off_peak_idle_time = 60
8782
runners_machine_autoscaling = [
8883
{
8984
periods = ["\"* * 0-9,17-23 * * mon-fri *\"", "\"* * * * * sat,sun *\""]

examples/runner-pre-registered/main.tf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ module "runner" {
4646
runners_gitlab_url = var.gitlab_url
4747
runners_token = var.runner_token
4848

49-
runners_off_peak_timezone = var.timezone
50-
runners_off_peak_idle_count = 0
51-
runners_off_peak_idle_time = 60
52-
5349
# working 9 to 5 :)
54-
runners_off_peak_periods = "[\"* * 0-9,17-23 * * mon-fri *\", \"* * * * * sat,sun *\"]"
50+
runners_machine_autoscaling = [
51+
{
52+
periods = ["\"* * 0-9,17-23 * * mon-fri *\"", "\"* * * * * sat,sun *\""]
53+
idle_count = 0
54+
idle_time = 60
55+
timezone = var.timezone
56+
}
57+
]
5558
}

locals.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,4 @@ locals {
2424
runners_machine_autoscaling = var.runners_machine_autoscaling
2525
}
2626
)
27-
28-
// Depcrecated off peak, ensure not set if not explicit set.
29-
runners_off_peak_periods_string = var.runners_off_peak_periods == null ? "" : format("OffPeakPeriods = %s", var.runners_off_peak_periods)
30-
runners_off_peak_timezone = var.runners_off_peak_timezone == null ? "" : "OffPeakTimezone = \"${var.runners_off_peak_timezone}\""
31-
runners_off_peak_idle_count = var.runners_off_peak_idle_count == -1 ? "" : format("OffPeakIdleCount = %d", var.runners_off_peak_idle_count)
32-
runners_off_peak_idle_time = var.runners_off_peak_idle_time == -1 ? "" : format("OffPeakIdleTime = %d", var.runners_off_peak_idle_time)
33-
3427
}

main.tf

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ resource "aws_ssm_parameter" "runner_sentry_dsn" {
5050
}
5151

5252
locals {
53-
enable_asg_recreation = var.enable_forced_updates != null ? !var.enable_forced_updates : var.enable_asg_recreation
54-
5553
template_user_data = templatefile("${path.module}/template/user-data.tpl",
5654
{
5755
eip = var.enable_eip ? local.template_eip : ""
@@ -131,10 +129,6 @@ locals {
131129
runners_idle_count = var.runners_idle_count
132130
runners_idle_time = var.runners_idle_time
133131
runners_max_builds = local.runners_max_builds_string
134-
runners_off_peak_timezone = local.runners_off_peak_timezone
135-
runners_off_peak_idle_count = local.runners_off_peak_idle_count
136-
runners_off_peak_idle_time = local.runners_off_peak_idle_time
137-
runners_off_peak_periods_string = local.runners_off_peak_periods_string
138132
runners_machine_autoscaling = local.runners_machine_autoscaling
139133
runners_root_size = var.runners_root_size
140134
runners_iam_instance_profile_name = var.runners_iam_instance_profile_name
@@ -171,7 +165,7 @@ data "aws_ami" "docker-machine" {
171165
}
172166

173167
resource "aws_autoscaling_group" "gitlab_runner_instance" {
174-
name = local.enable_asg_recreation ? "${aws_launch_template.gitlab_runner_instance.name}-asg" : "${var.environment}-as-group"
168+
name = var.enable_asg_recreation ? "${aws_launch_template.gitlab_runner_instance.name}-asg" : "${var.environment}-as-group"
175169
vpc_zone_identifier = var.subnet_ids_gitlab_runner
176170
min_size = "1"
177171
max_size = "1"

template/runner-config.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,4 @@ sentry_dsn = "${sentry_dsn}"
6262
${docker_machine_options}
6363
]
6464

65-
${runners_off_peak_timezone}
66-
${runners_off_peak_idle_count}
67-
${runners_off_peak_idle_time}
68-
${runners_off_peak_periods_string}
6965
${runners_machine_autoscaling}

variables.tf

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ variable "aws_region" {
33
type = string
44
}
55

6-
variable "aws_zone" {
7-
description = "Deprecated. Will be removed in the next major release."
8-
type = string
9-
default = "a"
10-
}
11-
126
variable "arn_format" {
137
type = string
148
default = "arn:aws"
@@ -231,30 +225,6 @@ variable "runners_ebs_optimized" {
231225
default = true
232226
}
233227

234-
variable "runners_off_peak_timezone" {
235-
description = "Deprecated, please use `runners_machine_autoscaling`. Off peak idle time zone of the runners, will be used in the runner config.toml."
236-
type = string
237-
default = null
238-
}
239-
240-
variable "runners_off_peak_idle_count" {
241-
description = "Deprecated, please use `runners_machine_autoscaling`. Off peak idle count of the runners, will be used in the runner config.toml."
242-
type = number
243-
default = -1
244-
}
245-
246-
variable "runners_off_peak_idle_time" {
247-
description = "Deprecated, please use `runners_machine_autoscaling`. Off peak idle time of the runners, will be used in the runner config.toml."
248-
type = number
249-
default = -1
250-
}
251-
252-
variable "runners_off_peak_periods" {
253-
description = "Deprecated, please use `runners_machine_autoscaling`. Off peak periods of the runners, will be used in the runner config.toml."
254-
type = string
255-
default = null
256-
}
257-
258228
variable "runners_machine_autoscaling" {
259229
description = "Set autoscaling parameters based on periods, see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersmachine-section"
260230
type = list(object({
@@ -701,12 +671,6 @@ variable "asg_max_instance_lifetime" {
701671
type = number
702672
}
703673

704-
variable "enable_forced_updates" {
705-
description = "DEPRECATED! and is replaced by `enable_asg_recreation. Setting this variable to true will do the opposite as expected. For backward compatibility the variable will remain some releases. Old desription: Enable automatic redeployment of the Runner ASG when the Launch Configs change."
706-
default = null
707-
type = string
708-
}
709-
710674
variable "permissions_boundary" {
711675
description = "Name of permissions boundary policy to attach to AWS IAM roles"
712676
default = ""

0 commit comments

Comments
 (0)