use different host sizes for test and prod envs
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
8dc2cebba9
commit
2b87f29f7c
2
host.tf
2
host.tf
|
@ -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"]
|
||||
|
|
6
main.tf
6
main.tf
|
@ -42,3 +42,9 @@ locals {
|
|||
zone.name => zone.id
|
||||
}
|
||||
}
|
||||
|
||||
/* WORKSPACES -----------------------------------*/
|
||||
|
||||
locals {
|
||||
ws = merge(local.env["defaults"], local.env[terraform.workspace])
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*/
|
Loading…
Reference in New Issue