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

Commit 08c484c

Browse files
jpalomakinpalm
authored andcommitted
refactor!: use optional in variable block_device_mappings (#2664)
refactor: use optiona for variable block_device_mappings
1 parent 086a2e1 commit 08c484c

File tree

2 files changed

+18
-34
lines changed

2 files changed

+18
-34
lines changed

modules/runners/variables.tf

+9-17
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,18 @@ variable "s3_runner_binaries" {
5858
variable "block_device_mappings" {
5959
description = "The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops`, `throughput`, `kms_key_id`, `snapshot_id`."
6060
type = list(object({
61-
delete_on_termination = bool
62-
device_name = string
63-
encrypted = bool
64-
iops = number
65-
kms_key_id = string
66-
snapshot_id = string
67-
throughput = number
61+
delete_on_termination = optional(bool, true)
62+
device_name = optional(string, "/dev/xvda")
63+
encrypted = optional(bool, true)
64+
iops = optional(number)
65+
kms_key_id = optional(string)
66+
snapshot_id = optional(string)
67+
throughput = optional(number)
6868
volume_size = number
69-
volume_type = string
69+
volume_type = optional(string, "gp3")
7070
}))
7171
default = [{
72-
delete_on_termination = true
73-
device_name = "/dev/xvda"
74-
encrypted = true
75-
iops = null
76-
kms_key_id = null
77-
snapshot_id = null
78-
throughput = null
79-
volume_size = 30
80-
volume_type = "gp3"
72+
volume_size = 30
8173
}]
8274
}
8375

variables.tf

+9-17
Original file line numberDiff line numberDiff line change
@@ -274,26 +274,18 @@ variable "runner_allow_prerelease_binaries" {
274274
variable "block_device_mappings" {
275275
description = "The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops`, `throughput`, `kms_key_id`, `snapshot_id`."
276276
type = list(object({
277-
delete_on_termination = bool
278-
device_name = string
279-
encrypted = bool
280-
iops = number
281-
kms_key_id = string
282-
snapshot_id = string
283-
throughput = number
277+
delete_on_termination = optional(bool, true)
278+
device_name = optional(string, "/dev/xvda")
279+
encrypted = optional(bool, true)
280+
iops = optional(number)
281+
kms_key_id = optional(string)
282+
snapshot_id = optional(string)
283+
throughput = optional(number)
284284
volume_size = number
285-
volume_type = string
285+
volume_type = optional(string, "gp3")
286286
}))
287287
default = [{
288-
delete_on_termination = true
289-
device_name = "/dev/xvda"
290-
encrypted = true
291-
iops = null
292-
kms_key_id = null
293-
snapshot_id = null
294-
throughput = null
295-
volume_size = 30
296-
volume_type = "gp3"
288+
volume_size = 30
297289
}]
298290
}
299291

0 commit comments

Comments
 (0)