Skip to content

Commit 32541af

Browse files
committed
fixremove deprecated terraform variables
1 parent d2d09ff commit 32541af

File tree

17 files changed

+38
-142
lines changed

17 files changed

+38
-142
lines changed

examples/default/outputs.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,3 @@ output "webhook_secret" {
1212
sensitive = true
1313
value = random_id.random.hex
1414
}
15-
16-
output "deprecated_variables_warning" {
17-
value = join("", [
18-
module.runners.deprecated_variables_warning,
19-
])
20-
}

examples/ephemeral/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ module "runners" {
8383

8484
# configure your pre-built AMI
8585
# enable_userdata = false
86-
# ami_filter = { name = ["github-runner-al2023-x86_64-*"], state = ["available"] }
87-
# ami_owners = [data.aws_caller_identity.current.account_id]
86+
# ami = {
87+
# filter = { name = ["github-runner-al2023-x86_64-*"], state = ["available"] }
88+
# owners = [data.aws_caller_identity.current.account_id]
89+
# }
8890

8991
# or use the default AMI
9092
# enable_userdata = true

examples/multi-runner/outputs.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ output "webhook_secret" {
66
sensitive = true
77
value = random_id.random.hex
88
}
9-
10-
output "deprecated_variables_warning" {
11-
value = join("", [
12-
module.runners.deprecated_variables_warning,
13-
])
14-
}

examples/multi-runner/templates/runner-configs/windows-x64.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ runner_config:
1515
delay_webhook_event: 5
1616
scale_down_schedule_expression: cron(* * * * ? *)
1717
runner_boot_time_in_minutes: 20
18-
ami_filter:
19-
name:
20-
- Windows_Server-2022-English-Full-ECS_Optimized-*
21-
state:
22-
- available
18+
ami:
19+
filter:
20+
name:
21+
- Windows_Server-2022-English-Full-ECS_Optimized-*
22+
state:
23+
- available

examples/prebuilt/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ Assuming you have built the `linux-al2023` image which has a pre-defined AMI nam
3333
module "runners" {
3434
...
3535
# set the name of the ami to use
36-
ami_filter = { name = ["github-runner-al2023-x86_64-2023*"], state = ["available"] }
37-
# provide the owner id of
38-
ami_owners = ["<your owner id>"]
36+
ami = {
37+
filter = { name = ["github-runner-al2023-x86_64-2023*"], state = ["available"] }
38+
# provide the owner id of
39+
owners = ["<your owner id>"]
40+
}
3941
4042
enable_userdata = false
4143
...
@@ -49,7 +51,10 @@ data "aws_caller_identity" "current" {}
4951
5052
module "runners" {
5153
...
52-
ami_owners = [data.aws_caller_identity.current.account_id]
54+
ami = {
55+
filter = { name = ["github-runner-al2023-x86_64-2023*"], state = ["available"] }
56+
owners = [data.aws_caller_identity.current.account_id]
57+
}
5358
...
5459
}
5560
```

examples/prebuilt/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ module "runners" {
4545

4646
# configure your pre-built AMI
4747
enable_userdata = false
48-
ami_filter = { name = [var.ami_name_filter], state = ["available"] }
49-
ami_owners = [data.aws_caller_identity.current.account_id]
48+
ami = {
49+
filter = { name = [var.ami_name_filter], state = ["available"] }
50+
owners = [data.aws_caller_identity.current.account_id]
51+
}
5052

5153
# disable binary syncer since github agent is already installed in the AMI.
5254
enable_runner_binaries_syncer = false

main.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,8 @@ module "runners" {
177177
instance_max_spot_price = var.instance_max_spot_price
178178
block_device_mappings = var.block_device_mappings
179179

180-
runner_architecture = var.runner_architecture
181-
ami = var.ami
182-
ami_filter = var.ami_filter
183-
ami_owners = var.ami_owners
184-
ami_id_ssm_parameter_name = var.ami_id_ssm_parameter_name
185-
ami_kms_key_arn = var.ami_kms_key_arn
180+
runner_architecture = var.runner_architecture
181+
ami = var.ami
186182

187183
sqs_build_queue = aws_sqs_queue.queued_builds
188184
github_app_parameters = local.github_app_parameters

modules/multi-runner/outputs.tf

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,3 @@ output "instance_termination_handler" {
6767
lambda_role = module.instance_termination_watcher[0].spot_termination_handler.lambda_role
6868
} : null
6969
}
70-
71-
output "deprecated_variables_warning" {
72-
description = "Warning for deprecated variables usage. These variables will be removed in a future release. Please migrate to using the consolidated 'ami' object in each runner configuration."
73-
value = join("", [
74-
for key, runner_config in var.multi_runner_config : (
75-
join("", [
76-
# Show object migration warning only when ami is null and old variables are used
77-
try(runner_config.runner_config.ami, null) == null ? (
78-
(try(runner_config.runner_config.ami_filter, { state = ["available"] }) != { state = ["available"] } ||
79-
try(runner_config.runner_config.ami_owners, ["amazon"]) != ["amazon"] ||
80-
try(runner_config.runner_config.ami_kms_key_arn, "") != "") ?
81-
"DEPRECATION WARNING: Runner '${key}' is using deprecated AMI variables (ami_filter, ami_owners, ami_kms_key_arn). These variables will be removed in a future version. Please migrate to using the consolidated 'ami' object.\n" : ""
82-
) : "",
83-
# Always show warning for ami_id_ssm_parameter_name to migrate to ami_id_ssm_parameter_arn
84-
try(runner_config.runner_config.ami_id_ssm_parameter_name, null) != null ?
85-
"DEPRECATION WARNING: Runner '${key}' is using deprecated variable 'ami_id_ssm_parameter_name'. Please use 'ami.id_ssm_parameter_arn' instead.\n" : ""
86-
])
87-
)
88-
])
89-
}

modules/multi-runner/runners.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ module "runners" {
2727

2828
runner_architecture = each.value.runner_config.runner_architecture
2929
ami = each.value.runner_config.ami
30-
ami_filter = each.value.runner_config.ami_filter
31-
ami_owners = each.value.runner_config.ami_owners
32-
ami_kms_key_arn = each.value.runner_config.ami_kms_key_arn
3330

3431
sqs_build_queue = { "arn" : each.value.arn, "url" : each.value.url }
3532
github_app_parameters = local.github_app_parameters

modules/multi-runner/variables.tf

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ variable "multi_runner_config" {
7070
owners = optional(list(string), ["amazon"])
7171
id_ssm_parameter_arn = optional(string, null)
7272
kms_key_arn = optional(string, null)
73-
}), null) # Defaults to null, in which case the module falls back to individual AMI variables (deprecated)
74-
# Deprecated: Use ami object instead
75-
ami_filter = optional(map(list(string)), { state = ["available"] })
76-
ami_owners = optional(list(string), ["amazon"])
77-
ami_id_ssm_parameter_name = optional(string, null)
78-
ami_kms_key_arn = optional(string, "")
73+
}), null)
7974
create_service_linked_role_spot = optional(bool, false)
8075
credit_specification = optional(string, null)
8176
delay_webhook_event = optional(number, 30)
@@ -183,8 +178,6 @@ variable "multi_runner_config" {
183178
runner_architecture: "The platform architecture of the runner instance_type."
184179
runner_metadata_options: "(Optional) Metadata options for the ec2 runner instances."
185180
ami: "(Optional) AMI configuration for the action runner instances. This object allows you to specify all AMI-related settings in one place."
186-
ami_filter: "(Optional) List of maps used to create the AMI filter for the action runner AMI. By default amazon linux 2 is used."
187-
ami_owners: "(Optional) The list of owners used to select the AMI of action runner instances."
188181
create_service_linked_role_spot: (Optional) create the serviced linked role for spot instances that is required by the scale-up lambda.
189182
credit_specification: "(Optional) The credit specification of the runner instance_type. Can be unset, `standard` or `unlimited`.
190183
delay_webhook_event: "The number of seconds the event accepted by the webhook is invisible on the queue before the scale up lambda will receive the event."

0 commit comments

Comments
 (0)