Skip to content

Commit 6650075

Browse files
author
arnol377
committed
Refactor volume configuration by removing root_volume variable and updating image_volume_mapping structure
1 parent 3b4e0ea commit 6650075

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

parameters_and_secrets.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ locals {
1515
troubleshoot = var.troubleshoot, # Enable troubleshooting mode.
1616
# Mapping of volumes to attach to the instance.
1717
volume_map = jsonencode(var.image_volume_mapping),
18-
root_volume = var.root_volume == null ? "" : jsonencode(var.root_volume),
1918

2019
key_name = "${var.project_name}-deployer-key-${random_pet.keyname.id}" # KMS key ID for encryption.
2120
}, var.playbook == null ? {} : {

variables.tf

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -359,23 +359,6 @@ variable "kms_key_id" {
359359
default = null
360360
}
361361

362-
variable "image_volume_mapping" {
363-
type = list(object({
364-
device_name = string
365-
volume_size = number
366-
volume_type = string
367-
delete_on_termination = bool
368-
encrypted = optional(bool, false)
369-
iops = optional(number, null)
370-
snapshot_id = optional(string, null)
371-
throughput = optional(number, null)
372-
virtual_name = optional(string, null)
373-
kms_key_id = optional(string, null)
374-
mount_path = optional(string, null)
375-
}))
376-
default = []
377-
}
378-
379362
variable "required_packages" {
380363
type = list(object({
381364
src = string
@@ -395,17 +378,19 @@ variable "instance_profile" {
395378
default = null
396379
}
397380

398-
variable "root_volume" {
399-
type = object({
381+
variable "image_volume_mapping" {
382+
type = list(object({
400383
device_name = string
401384
volume_size = number
402385
volume_type = string
403386
delete_on_termination = bool
404387
encrypted = optional(bool, false)
405388
iops = optional(number, null)
389+
snapshot_id = optional(string, null)
406390
throughput = optional(number, null)
391+
virtual_name = optional(string, null)
407392
kms_key_id = optional(string, null)
408-
})
409-
description = "Configuration for the root volume"
410-
default = null
393+
mount_path = optional(string, null)
394+
}))
395+
default = []
411396
}

0 commit comments

Comments
 (0)