Skip to content

Commit 3b5cabb

Browse files
authored
feat(examples/templates/aws-devcontainer): add root volume parameter, growpart automatically (#14839)
Fixes #14833
1 parent a3ffab6 commit 3b5cabb

File tree

1 file changed

+19
-1
lines changed
  • examples/templates/aws-devcontainer

1 file changed

+19
-1
lines changed

examples/templates/aws-devcontainer/main.tf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@ data "coder_parameter" "instance_type" {
8888
}
8989
}
9090

91+
data "coder_parameter" "root_volume_size_gb" {
92+
name = "root_volume_size_gb"
93+
display_name = "Root Volume Size (GB)"
94+
description = "How large should the root volume for the instance be?"
95+
default = 30
96+
type = "number"
97+
mutable = true
98+
validation {
99+
min = 1
100+
monotonic = "increasing"
101+
}
102+
}
103+
91104
data "coder_parameter" "fallback_image" {
92105
default = "codercom/enterprise-base:ubuntu"
93106
description = "This image runs if the devcontainer fails to build."
@@ -197,6 +210,11 @@ locals {
197210
shell: /bin/bash
198211
ssh_authorized_keys:
199212
- "${data.coder_parameter.ssh_pubkey.value}"
213+
# Automatically grow the partition
214+
growpart:
215+
mode: auto
216+
devices: ['/']
217+
ignore_growroot_disabled: false
200218
201219
--//
202220
Content-Type: text/x-shellscript; charset="us-ascii"
@@ -268,7 +286,7 @@ resource "aws_instance" "vm" {
268286
instance_type = data.coder_parameter.instance_type.value
269287
iam_instance_profile = try(data.aws_iam_instance_profile.vm_instance_profile[0].name, null)
270288
root_block_device {
271-
volume_size = 30
289+
volume_size = data.coder_parameter.root_volume_size_gb.value
272290
}
273291

274292
user_data = local.user_data

0 commit comments

Comments
 (0)