-
Notifications
You must be signed in to change notification settings - Fork 887
change default aws linux instance type to t3.micro, reduce default template TTL #2776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
ea3d5e0
9005e0d
b94a3ee
944dbfa
f4c0d93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,22 @@ variable "region" { | |
} | ||
} | ||
|
||
variable "instance_type" { | ||
description = "What instance type should your workspace use?" | ||
default = "2C/1G: t3.micro" | ||
validation { | ||
condition = contains([ | ||
"2C/1G: t3.micro", | ||
"2C/2G: t3.small", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wasn't immediately clear what "C" and "G" meant in this context. I eventually realized it was vCPU and GB RAM, but I think 2 vCPU / 2 GB RAM is clearer and it's not like we're hurting for space in this context, nor do the users have to type these values in our UX. Unfortunately the vCPU number is a little misleading for T3 instances. Micro-large have the same number of vCPUs, and reading this you might conclude that they have the same CPU performance. They do not. Amazon throttles the CPUs except for short bursts and the amount of throttling is different for the different instance sizes. I'm not really sure what to suggest except to drop the stats and just include the instance type names. Up to you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can drop the stats, I only put them in there so the instance types would show up in the right order :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you could do numbered list, |
||
"2C/4G: t3.medium", | ||
"2C/8G: t3.large", | ||
"4C/16G: t3.xlarge", | ||
"8C/32G: t3.2xlarge", | ||
], var.instance_type) | ||
error_message = "Invalid instance type!" | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = var.region | ||
} | ||
|
@@ -130,7 +146,7 @@ EOT | |
resource "aws_instance" "dev" { | ||
ami = data.aws_ami.ubuntu.id | ||
availability_zone = "${var.region}a" | ||
instance_type = "t3.xlarge" | ||
instance_type = split(": ", "${var.instance_type}")[1] | ||
|
||
user_data = data.coder_workspace.me.transition == "start" ? local.user_data_start : local.user_data_end | ||
tags = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a few instances where defining the
default
skipped the prompt. I'm guessing this is not the case here? (Just checking.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall it being the case when I tested it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it's probably fine 👍, could've been related to variables marked
sensitive
(and that behavior might've changed already, it was a while ago).