diff --git a/examples/templates/aws-devcontainer/main.tf b/examples/templates/aws-devcontainer/main.tf index ea60b7a9b25b6..27434385c647b 100644 --- a/examples/templates/aws-devcontainer/main.tf +++ b/examples/templates/aws-devcontainer/main.tf @@ -88,6 +88,19 @@ data "coder_parameter" "instance_type" { } } +data "coder_parameter" "root_volume_size_gb" { + name = "root_volume_size_gb" + display_name = "Root Volume Size (GB)" + description = "How large should the root volume for the instance be?" + default = 30 + type = "number" + mutable = true + validation { + min = 1 + monotonic = "increasing" + } +} + data "coder_parameter" "fallback_image" { default = "codercom/enterprise-base:ubuntu" description = "This image runs if the devcontainer fails to build." @@ -197,6 +210,11 @@ locals { shell: /bin/bash ssh_authorized_keys: - "${data.coder_parameter.ssh_pubkey.value}" + # Automatically grow the partition + growpart: + mode: auto + devices: ['/'] + ignore_growroot_disabled: false --// Content-Type: text/x-shellscript; charset="us-ascii" @@ -268,7 +286,7 @@ resource "aws_instance" "vm" { instance_type = data.coder_parameter.instance_type.value iam_instance_profile = try(data.aws_iam_instance_profile.vm_instance_profile[0].name, null) root_block_device { - volume_size = 30 + volume_size = data.coder_parameter.root_volume_size_gb.value } user_data = local.user_data