forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkspaces.tf
More file actions
39 lines (35 loc) · 865 Bytes
/
Copy pathworkspaces.tf
File metadata and controls
39 lines (35 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Multi-environment workspace configuration
locals {
env_config = {
dev = {
instance_type = "t3.micro"
min_capacity = 1
max_capacity = 2
}
staging = {
instance_type = "t3.small"
min_capacity = 1
max_capacity = 3
}
prod = {
instance_type = "t3.medium"
min_capacity = 2
max_capacity = 10
}
}
current_env = terraform.workspace
current_config = lookup(local.env_config, local.current_env, local.env_config["dev"])
}
variable "app_name" {
description = "Application name"
type = string
default = "gistpin"
}
output "workspace_name" {
description = "Current Terraform workspace"
value = terraform.workspace
}
output "instance_type" {
description = "Instance type for current environment"
value = local.current_config.instance_type
}