infra-status/workspaces.tf

32 lines
647 B
HCL

/**
* 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
do_type = "s-1vcpu-2gb" /* DigitalOcean */
ac_type = "ecs.t5-lc1m2.small" /* Alibaba Cloud */
gc_type = "g1-small" /* Google Cloud */
}
# Inherits defaults.
test = {}
prod = {}
}
}
locals {
ws = merge(local.env["defaults"], local.env[terraform.workspace])
}