2022-02-15 12:28:32 +00:00
|
|
|
/**
|
|
|
|
* 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 = {
|
|
|
|
/* general */
|
|
|
|
env = "status"
|
|
|
|
stage = terraform.workspace
|
|
|
|
|
2023-11-23 10:48:10 +00:00
|
|
|
/* Waku nodes */
|
|
|
|
node_count = 1
|
|
|
|
node_do_type = "s-1vcpu-2gb" /* DigitalOcean */
|
|
|
|
node_ac_type = "ecs.t5-lc1m2.small" /* Alibaba Cloud */
|
|
|
|
node_gc_type = "g1-small" /* Google Cloud */
|
|
|
|
node_ac_data_vol_type = "cloud_ssd"
|
2023-11-23 11:33:53 +00:00
|
|
|
node_data_vol_size = 40 /* TODO Remove in favor of DB hosts. */
|
|
|
|
|
|
|
|
/* PostgreSQL */
|
|
|
|
db_count = 1
|
|
|
|
db_do_type = "s-1vcpu-2gb" /* DigitalOcean */
|
|
|
|
db_data_vol_size = 40
|
2022-02-15 12:28:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Inherits defaults.
|
2023-12-04 11:49:06 +00:00
|
|
|
test = {
|
|
|
|
db_do_type = "s-2vcpu-2gb"
|
|
|
|
}
|
2023-06-26 11:26:44 +00:00
|
|
|
prod = {
|
2023-11-23 10:48:10 +00:00
|
|
|
node_count = 2
|
|
|
|
node_data_vol_size = 350
|
2023-11-23 11:33:53 +00:00
|
|
|
db_data_vol_size = 300
|
2023-06-26 11:26:44 +00:00
|
|
|
}
|
2022-02-15 12:28:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
locals {
|
|
|
|
ws = merge(local.env["defaults"], local.env[terraform.workspace])
|
|
|
|
}
|