generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvariables.tf
287 lines (249 loc) · 10.7 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
##############################################################################
# Cluster variables
##############################################################################
variable "cluster_id" {
type = string
description = "The ID of the cluster you wish to deploy the agents in"
}
variable "cluster_resource_group_id" {
type = string
description = "The Resource Group ID of the cluster"
}
variable "cluster_config_endpoint_type" {
description = "Specify which type of endpoint to use for for cluster config access: 'default', 'private', 'vpe', 'link'. 'default' value will use the default endpoint of the cluster."
type = string
default = "default"
nullable = false # use default if null is passed in
validation {
error_message = "Invalid Endpoint Type! Valid values are 'default', 'private', 'vpe', or 'link'"
condition = contains(["default", "private", "vpe", "link"], var.cluster_config_endpoint_type)
}
}
variable "is_vpc_cluster" {
description = "Specify true if the target cluster for the observability agents is a VPC cluster, false if it is a classic cluster."
type = bool
default = true
}
variable "wait_till" {
description = "To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` and `Normal`"
type = string
default = "Normal"
validation {
error_message = "`wait_till` value must be one of `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` or `Normal`."
condition = contains([
"MasterNodeReady",
"OneWorkerNodeReady",
"IngressReady",
"Normal"
], var.wait_till)
}
}
variable "wait_till_timeout" {
description = "Timeout for wait_till in minutes."
type = number
default = 90
}
##############################################################################
# Cloud Monitoring variables
##############################################################################
variable "cloud_monitoring_enabled" {
type = bool
description = "Deploy IBM Cloud Monitoring agent"
default = true
}
variable "cloud_monitoring_access_key" {
type = string
description = "Access key used by the IBM Cloud Monitoring agent to communicate with the instance"
sensitive = true
default = null
}
variable "cloud_monitoring_secret_name" {
type = string
description = "The name of the secret which will store the access key."
default = "sysdig-agent"
nullable = false
}
variable "cloud_monitoring_instance_region" {
type = string
description = "The IBM Cloud Monitoring instance region. Used to construct the ingestion endpoint."
default = null
}
variable "cloud_monitoring_endpoint_type" {
type = string
description = "Specify the IBM Cloud Monitoring instance endpoint type (public or private) to use. Used to construct the ingestion endpoint."
default = "private"
validation {
error_message = "The specified endpoint_type can be private or public only."
condition = contains(["private", "public"], var.cloud_monitoring_endpoint_type)
}
}
variable "cloud_monitoring_metrics_filter" {
type = list(object({
type = string
name = string
}))
description = "To filter custom metrics, specify the Cloud Monitoring metrics to include or to exclude. See https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_inc_exc_metrics."
default = []
validation {
condition = length(var.cloud_monitoring_metrics_filter) == 0 || can(regex("^(include|exclude)$", var.cloud_monitoring_metrics_filter[0].type))
error_message = "Invalid input for `cloud_monitoring_metrics_filter`. Valid options for 'type' are: `include` and `exclude`. If empty, no metrics are included or excluded."
}
}
variable "cloud_monitoring_container_filter" {
type = list(object({
type = string
parameter = string
name = string
}))
description = "To filter custom containers, specify the Cloud Monitoring containers to include or to exclude. See https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_filter_data."
default = []
validation {
condition = length(var.cloud_monitoring_container_filter) == 0 || can(regex("^(include|exclude)$", var.cloud_monitoring_container_filter[0].type))
error_message = "Invalid input for `cloud_monitoring_container_filter`. Valid options for 'type' are: `include` and `exclude`. If empty, no containers are included or excluded."
}
}
variable "cloud_monitoring_agent_tags" {
type = list(string)
description = "List of tags to associate to all matrics that the agent collects. NOTE: Use the 'cloud_monitoring_add_cluster_name' variable to add the cluster name as a tag."
default = []
nullable = false
validation {
condition = alltrue([for tags in var.cloud_monitoring_agent_tags : !can(regex("\\s", tags))])
error_message = "The cloud monitoring agent tags must not contain any spaces."
}
}
variable "cloud_monitoring_add_cluster_name" {
type = bool
description = "If true, configure the cloud monitoring agent to attach a tag containing the cluster name to all metric data."
default = true
}
variable "cloud_monitoring_agent_name" {
description = "Cloud Monitoring agent name. Used for naming all kubernetes and helm resources on the cluster."
type = string
default = "sysdig-agent"
}
variable "cloud_monitoring_agent_namespace" {
type = string
description = "Namespace where to deploy the Cloud Monitoring agent. Default value is 'ibm-observe'"
default = "ibm-observe"
nullable = false
}
variable "cloud_monitoring_agent_tolerations" {
description = "List of tolerations to apply to Cloud Monitoring agent."
type = list(object({
key = optional(string)
operator = optional(string)
value = optional(string)
effect = optional(string)
tolerationSeconds = optional(number)
}))
default = [{
operator = "Exists"
},
{
operator : "Exists"
effect : "NoSchedule"
key : "node-role.kubernetes.io/master"
}]
}
##############################################################################
# Logs Agents variables
##############################################################################
variable "logs_agent_enabled" {
type = bool
description = "Whether to deploy the Logs agent."
default = true
}
variable "logs_agent_name" {
description = "The name of the Logs agent. The name is used in all Kubernetes and Helm resources in the cluster."
type = string
default = "logs-agent"
nullable = false
}
variable "logs_agent_namespace" {
type = string
description = "The namespace where the Logs agent is deployed. The default value is `ibm-observe`."
default = "ibm-observe"
nullable = false
}
variable "logs_agent_trusted_profile" {
type = string
description = "The IBM Cloud trusted profile ID. Used only when `logs_agent_iam_mode` is set to `TrustedProfile`. The trusted profile must have an IBM Cloud Logs `Sender` role."
default = null
}
variable "logs_agent_iam_api_key" {
type = string
description = "The IBM Cloud API key for the Logs agent to authenticate and communicate with the IBM Cloud Logs. It is required if `logs_agent_iam_mode` is set to `IAMAPIKey`."
sensitive = true
default = null
}
variable "logs_agent_tolerations" {
description = "List of tolerations to apply to Logs agent. The default value means a pod will run on every node."
type = list(object({
key = optional(string)
operator = optional(string)
value = optional(string)
effect = optional(string)
tolerationSeconds = optional(number)
}))
default = [{
operator = "Exists"
}]
}
variable "logs_agent_additional_log_source_paths" {
type = list(string)
description = "The list of additional log sources. By default, the Logs agent collects logs from a single source at `/var/log/containers/*.log`."
default = []
nullable = false
}
variable "logs_agent_exclude_log_source_paths" {
type = list(string)
description = "The list of log sources to exclude. Specify the paths that the Logs agent ignores."
default = []
nullable = false
}
variable "logs_agent_selected_log_source_paths" {
type = list(string)
description = "The list of specific log sources paths. Logs will only be collected from the specified log source paths. If no paths are specified, it will send logs from `/var/log/containers`."
default = []
nullable = false
}
variable "logs_agent_log_source_namespaces" {
type = list(string)
description = "The list of namespaces from which logs should be forwarded by agent. If namespaces are not listed, logs from all namespaces will be sent."
default = []
nullable = false
}
variable "logs_agent_iam_mode" {
type = string
default = "TrustedProfile"
description = "IAM authentication mode: `TrustedProfile` or `IAMAPIKey`."
}
variable "logs_agent_iam_environment" {
type = string
default = "PrivateProduction"
description = "IAM authentication Environment: `Production` or `PrivateProduction` or `Staging` or `PrivateStaging`. `Production` specifies the public endpoint & `PrivateProduction` specifies the private endpoint."
}
variable "logs_agent_additional_metadata" {
description = "The list of additional metadata fields to add to the routed logs."
type = list(object({
key = optional(string)
value = optional(string)
}))
default = []
}
variable "logs_agent_enable_scc" {
description = "Whether to enable creation of Security Context Constraints in Openshift. When installing on an OpenShift cluster, this setting is mandatory to configure permissions for pods within your cluster."
type = bool
default = true
}
variable "cloud_logs_ingress_endpoint" {
description = "The host for IBM Cloud Logs ingestion. Ensure you use the ingress endpoint. See https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-endpoints_ingress."
type = string
default = null
}
variable "cloud_logs_ingress_port" {
type = number
default = 3443
description = "The target port for the IBM Cloud Logs ingestion endpoint. The port must be 443 if you connect by using a VPE gateway, or port 3443 when you connect by using CSEs."
}