-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
96 lines (89 loc) · 2.9 KB
/
variables.tf
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# --- variables predefined by OCI Stacks
variable "tenancy_ocid" { }
variable "compartment_ocid" { }
variable "region" { }
variable "current_user_ocid" { }
# --- user-input by OCI
variable "dacslabs_link_b64" { type = string }
variable "rockit_base_link_b64" { type = string }
variable "env_label" { type = string }
variable "RSI_URL" {
type = string
default = "https://public.cloud.rockitplay.com/rsi"
}
variable "N_CONTAINER_INSTANCES" {
type = number
default = 0
}
variable "MONGODBATLAS_REGION_SERVERLESS" {
type = string
default = ""
}
variable "MONGODBATLAS_REGION_CLUSTER_M5" {
type = string
default = ""
}
variable "MONGODBATLAS_REGION_CLUSTER_M0" {
type = string
default = ""
}
variable "WORKSPACE" { type = string }
variable "ENGINE_SLACK_ADMIN_CHANNEL" { type = string }
variable "ENGINE_SLACK_ERROR_CHANNEL" { type = string }
variable "ENGINE_SLACK_INFO_CHANNEL" { type = string }
variable "EDGE_SLACK_ADMIN_CHANNEL" { type = string }
variable "EDGE_SLACK_ERROR_CHANNEL" { type = string }
variable "EDGE_SLACK_INFO_CHANNEL" { type = string }
locals {
env = lower (split (":", var.env_label)[0])
ENV = upper (local.env)
workspace = lower (var.WORKSPACE)
WORKSPACE = upper (var.WORKSPACE)
dacslabs_link = base64decode (split (".", var.dacslabs_link_b64)[1])
engine_dx_url = chomp (split (",", local.dacslabs_link)[1])
edge_dx_url = chomp (split (",", local.dacslabs_link)[2])
rockit_base_link = base64decode (split (".", var.rockit_base_link_b64)[1])
rockitplay_comp_ocid = split (",", local.rockit_base_link)[0]
vault_ocid = split (",", local.rockit_base_link)[1]
vault_key_ocid = split (",", local.rockit_base_link)[2]
baseenv_id = split (",", local.rockit_base_link)[3]
N_CONTAINER_INSTANCES = {
prod = max (1, var.N_CONTAINER_INSTANCES)
stage = max (1, var.N_CONTAINER_INSTANCES)
test = var.N_CONTAINER_INSTANCES
}
mongodbatlas_engine = {
prod = {
type = "serverless"
size = ""
region = split (":", var.MONGODBATLAS_REGION_SERVERLESS)[0]
}
stage = {
type = "serverless"
size = ""
region = split (":", var.MONGODBATLAS_REGION_SERVERLESS)[0]
}
test = {
type = "cluster"
size = "M0"
region = split (":", var.MONGODBATLAS_REGION_CLUSTER_M0)[0]
}
}
mongodbatlas_edge = {
prod = {
type = "cluster"
size = "M5"
region = split (":", var.MONGODBATLAS_REGION_CLUSTER_M5)[0]
}
stage = {
type = "serverless"
size = ""
region = split (":", var.MONGODBATLAS_REGION_SERVERLESS)[0]
}
test = {
type = "cluster"
size = "M0"
region = split (":", var.MONGODBATLAS_REGION_CLUSTER_M0)[0]
}
}
}