Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion examples/templates/aws-devcontainer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
Comment on lines +214 to +217
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


--//
Content-Type: text/x-shellscript; charset="us-ascii"
Expand Down Expand Up @@ -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
Expand Down
Loading