-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
137 lines (115 loc) · 3.21 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
variable "org_meta" {
description = "Organisation domain and top level domain"
type = object({
name = string
short_name = string
url = string
})
}
variable "project_meta" {
description = "Metadata relating to the project for which the database is being created"
type = object({
name = string
short_name = string
version = string
url = string
})
}
variable "deployment_environment" {
description = "Deployment flavour or variant identified by this name"
type = string
}
variable "vpc_id" {
description = "VPC ID in which to host resources"
type = string
validation {
condition = startswith(var.vpc_id, "vpc-")
error_message = "VPC ID must start with `vpc-`"
}
}
variable "subnet_ids" {
description = "List of Subnet IDs - preferably private subnets - in which to host the RDS instance"
type = list(string)
}
variable "master_password" {
description = "Master password supplied by the administrator; If set, this will be used over auto-generated password"
type = string
sensitive = true
default = ""
}
// NOTE: Password is generated automatically and stored in AWS Secrets Manager
variable "database" {
description = "PostgreSQL connection parameters and version."
type = object({
name = string
admin_user = string
password_length = number
engine_version = number
port = number
})
}
variable "serverless_capacity" {
description = "Minimum and maximum APU to assign to the RDS cluster"
type = object({
minimum = number
maximum = number
})
default = {
minimum = 0.5
maximum = 16
}
}
variable "deletion_protection" {
description = "Should the RDS cluster be protected against accidental deletion?"
type = bool
default = false
}
variable "monitoring" {
description = "Database monitoring options; 0 interval means enhanced monitoring is disabled"
type = object({
interval_seconds = number
performance_insights_enabled = bool
performance_insights_retention_days = number
})
default = {
interval_seconds = 0
performance_insights_enabled = true
performance_insights_retention_days = 7
}
validation {
condition = contains(
[0, 1, 5, 10, 15, 30, 60],
lookup(var.monitoring, "interval_seconds")
)
error_message = "Enhanced monitoring interval must be one of 0, 1, 5. 10, 15, 30 or 60 seconds"
}
}
variable "backup" {
description = "Database backups and snapshots"
type = object({
retention_days = number
skip_final_snapshot = bool
final_snapshot_identifier = string
})
default = {
retention_days = 7
skip_final_snapshot = false
final_snapshot_identifier = "final"
}
}
variable "public_access" {
description = "Should the database be publicly accessible?"
type = bool
default = false
}
variable "default_tags" {
description = "Default resource tags to apply to AWS resources"
type = map(string)
default = {
project = ""
maintainer = ""
documentation = ""
cost_center = ""
IaC_Management = "Terraform"
}
}