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
|
|
|
|
|
|
|
|
/* scaling */
|
|
|
|
hosts_count = 1
|
2023-06-26 11:26:44 +00:00
|
|
|
data_volume_size = 40
|
|
|
|
ac_data_volume_type = "cloud_ssd"
|
2022-02-15 12:28:32 +00:00
|
|
|
do_type = "s-1vcpu-2gb" /* DigitalOcean */
|
|
|
|
ac_type = "ecs.t5-lc1m2.small" /* Alibaba Cloud */
|
|
|
|
gc_type = "g1-small" /* Google Cloud */
|
|
|
|
}
|
|
|
|
|
|
|
|
# Inherits defaults.
|
2022-02-15 14:57:58 +00:00
|
|
|
test = { hosts_count = 1 }
|
2023-06-26 11:26:44 +00:00
|
|
|
prod = {
|
|
|
|
hosts_count = 2
|
2023-08-11 07:57:51 +00:00
|
|
|
data_volume_size = 80
|
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])
|
|
|
|
}
|