use different host sizes for test and prod envs

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-01-26 19:31:52 +01:00
parent 8dc2cebba9
commit 2b87f29f7c
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 31 additions and 1 deletions

View File

@ -8,7 +8,7 @@ module "main" {
host_count = 1
env = "referral"
group = "referral"
size = "s-4vcpu-8gb"
size = local.ws["host_size"]
domain = var.domain
open_tcp_ports = ["80", "443"]

View File

@ -42,3 +42,9 @@ locals {
zone.name => zone.id
}
}
/* WORKSPACES -----------------------------------*/
locals {
ws = merge(local.env["defaults"], local.env[terraform.workspace])
}

24
workspaces.tf Normal file
View File

@ -0,0 +1,24 @@
/* WORKSPACES ---------------------------------------------*/
/**
* This is a hacky way of binding specific variable
* values to different Terraform workspaces.
*
* Details:
* https://github.com/hashicorp/terraform/issues/15966
*/
locals {
env = {
defaults = {
host_size = "s-1vcpu-2gb"
}
test = {}
prod = {
host_size = "s-4vcpu-8gb"
}
}
}
/*---------------------------------------------------------*/