Skip to content

Commit 3b4e0ea

Browse files
author
arnol377
committed
Add root volume configuration to variables and update locals for provisioning
1 parent 7806ab2 commit 3b4e0ea

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

parameters_and_secrets.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
locals {
32
# Define a map of parameters for infrastructure provisioning.
43
# This includes configurations like region, subnets, security group IDs, VPC ID, source AMI, and more.
@@ -15,7 +14,8 @@ locals {
1514
playbook = var.playbook, # Ansible playbook for configuration management.
1615
troubleshoot = var.troubleshoot, # Enable troubleshooting mode.
1716
# Mapping of volumes to attach to the instance.
18-
volume_map = jsonencode(var.image_volume_mapping)
17+
volume_map = jsonencode(var.image_volume_mapping),
18+
root_volume = var.root_volume == null ? "" : jsonencode(var.root_volume),
1919

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

variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,18 @@ variable "instance_profile" {
394394
type = string
395395
default = null
396396
}
397+
398+
variable "root_volume" {
399+
type = object({
400+
device_name = string
401+
volume_size = number
402+
volume_type = string
403+
delete_on_termination = bool
404+
encrypted = optional(bool, false)
405+
iops = optional(number, null)
406+
throughput = optional(number, null)
407+
kms_key_id = optional(string, null)
408+
})
409+
description = "Configuration for the root volume"
410+
default = null
411+
}

0 commit comments

Comments
 (0)