change default aws linux instance type to t3.micro, reduce default template TTL (#2776)

- make default template max TTL 24 hours (still less than 168)
- make default workspace autostop 2 hours unless specified otherwise
- add instance type selector to aws templates
This commit is contained in:
Cian Johnston
2022-07-12 19:37:59 +01:00
committed by GitHub
parent c07a45e610
commit 5e6320163d
4 changed files with 36 additions and 4 deletions
+17 -1
View File
@@ -36,6 +36,22 @@ variable "region" {
}
}
variable "instance_type" {
description = "What instance type should your workspace use?"
default = "t3.micro"
validation {
condition = contains([
"t3.micro",
"t3.small",
"t3.medium",
"t3.large",
"t3.xlarge",
"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 = "${var.instance_type}"
user_data = data.coder_workspace.me.transition == "start" ? local.user_data_start : local.user_data_end
tags = {
+17 -1
View File
@@ -36,6 +36,22 @@ variable "region" {
}
}
variable "instance_type" {
description = "What instance type should your workspace use?"
default = "t3.micro"
validation {
condition = contains([
"t3.micro",
"t3.small",
"t3.medium",
"t3.large",
"t3.xlarge",
"t3.2xlarge",
], var.instance_type)
error_message = "Invalid instance type!"
}
}
provider "aws" {
region = var.region
}
@@ -83,7 +99,7 @@ EOT
resource "aws_instance" "dev" {
ami = data.aws_ami.windows.id
availability_zone = "${var.region}a"
instance_type = "t3.micro"
instance_type = "${var.instance_type}"
count = 1
user_data = data.coder_workspace.me.transition == "start" ? local.user_data_start : local.user_data_end