-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvariables.tf
65 lines (57 loc) · 1.54 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
# 'Constants'
locals {
region = data.aws_region.current.name
account_id = data.aws_caller_identity.current.account_id
output_path = "${path.module}/.files/init.zip"
}
variable "cluster_identifier" {
type = string
description = "DocumentDB cluster identifier."
}
variable "name" {
type = string
default = "docdb-autoscaling"
description = "Resources name."
}
variable "min_capacity" {
type = number
default = 0
description = "The minimum capacity."
# Idiot-proof
validation {
condition = var.min_capacity >= 0
error_message = "Minimum capacity cannot be lower than 0."
}
# Source: https://docs.aws.amazon.com/documentdb/latest/developerguide/how-it-works.html
validation {
condition = var.min_capacity <= 15
error_message = "DocumentDB does not allow more than 15 replica instances."
}
}
variable "max_capacity" {
type = number
default = 15
description = "The maximum capacity."
# Source: https://docs.aws.amazon.com/documentdb/latest/developerguide/how-it-works.html
validation {
condition = var.max_capacity <= 15
error_message = "DocumentDB does not allow more than 15 replica instances."
}
}
variable "scaling_policy" {
type = list(object({
metric_name = string
target = number
statistic = string
cooldown = number
}))
description = "The auto-scaling policy."
default = [
{
metric_name = "CPUUtilization"
target = 60
statistic = "Average"
cooldown = 120
}
]
}