Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ module "dfc2" {
source = "./modules/dfc"
infrastructure_root_domain = var.infrastructure_root_domain
name_prefix = "dfc2-"
# was m6a.large (2 vCPU, 8 GiB); see the merge conditions in the PR that changed this
instance_type = "t3a.large"
# explicit CNAMEs that override the dfc server's "*" wildcard record, for services moved to dfc2
extra_hostnames = [for name in ["redash", "vault"] : name if local.moved_to_dfc2[name]]
vpc_id = "vpc-028a1b06928595f30"
Expand Down
11 changes: 10 additions & 1 deletion modules/dfc/main_docker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ resource "aws_eip_association" "main_docker" {
resource "aws_instance" "main_docker" {
ami = "ami-0faab6bdbac9486fb"
availability_zone = "eu-central-1b"
instance_type = "m6a.large"
instance_type = var.instance_type
# burstable (t*) instances only: "unlimited" never throttles the CPU, but bills extra if it stays above
# the baseline for long (watch the CPUSurplusCreditsCharged metric); "standard" throttles instead
dynamic "credit_specification" {
# burstable families only: t2, t3, t3a, t4g... (not e.g. trn1)
for_each = can(regex("^t[0-9]", var.instance_type)) ? [1] : []
content {
cpu_credits = var.cpu_credits
}
}
vpc_security_group_ids = [
var.name_prefix == "" ? aws_security_group.default[0].id : var.security_group_id
]
Expand Down
11 changes: 11 additions & 0 deletions modules/dfc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ variable "extra_hostnames" {
description = "extra CNAMEs in the infrastructure root domain pointing to this server, e.g. vault"
}

variable "instance_type" {
type = string
default = "m6a.large"
}

variable "cpu_credits" {
type = string
default = "unlimited"
description = "only used for burstable (t*) instance types: unlimited or standard"
}

variable "aws_default_ssh_key_name" {
type = string
default = null
Expand Down