generated from north-kite/repo-template-terraform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
169 lines (145 loc) · 4.64 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
# Required Variables
variable "env" {
description = "Environment name, used in resource names (e.g. dev, stage, prod)"
type = string
}
variable "ecs_cluster" {
description = "ECS Cluster to deploy to"
type = object({
arn = string
name = string
})
}
variable "vpc_id" {
description = "VPC that resources should be deployed to"
type = string
}
variable "subnets" {
description = "List of subnet IDs to deploy the service to"
type = set(string)
}
variable "alb_listener_config" {
description = "Map of config for application load balancer listeners"
type = object({
port = number
health_check_port = number
protocol = string # HTTP or HTTPS
allowed_cidr_blocks = list(string)
certificate_arn = string # required if protocol is HTTPS
path = string
})
}
# Optional Variables
variable "service_name" {
description = "(Optional) Name of the service/product/application this Gatus belongs to"
type = string
default = "my-service"
}
variable "enable_execute_command" {
description = "(Optional) Enable Amazon ECS Exec for tasks"
type = bool
default = true
}
variable "platform_version" {
description = "(Optional) ECS Fargate platform version"
type = string
default = "1.4.0"
}
variable "use_fargate" {
description = "(Optional) Launch on Fargate. If set to `false` then EC2 will be used"
type = bool
default = true
}
variable "size" {
description = "(Optional) Number of ECS tasks to run"
type = object({
min = number
max = number
desired = number
})
default = {
min = 0
max = 2
desired = 1
}
}
variable "security_groups" {
description = "(Optional) List of additional security group IDs to assign to the service"
type = list(string)
default = []
}
variable "cpu" {
description = "(Optional) CPU to allocate to each Gatus"
type = number
default = 256
validation {
condition = contains([256, 512, 1024, 2048, 4096], var.cpu)
error_message = "Must be one of the following values: 256, 512, 1024, 2048, 4096."
}
}
variable "memory" {
description = "(Optional) Memory to allocate to each Gatus"
type = number
default = 512
validation {
condition = contains([512, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, 30720], var.memory)
error_message = "Must be either 512 or a multiple of 1024, up to 30720."
}
}
variable "image" {
description = "(Optional) Container image URI to use for Gatus"
type = string
default = "twinproduction/gatus:v4.2.0"
}
variable "config_path" {
description = "(Optional) File location of config files within container"
type = string
default = "/config/"
}
variable "log_group" {
description = "(Optional) The CloudWatch Log Group for service to send logs to"
type = object({
arn = string
region = string
})
default = null
}
variable "execution_role_arn" {
description = "(Optional) ARN of the IAM role to launch the ECS task"
type = string
# default = null # TODO create if null OR make required
}
variable "alb" {
description = "(Optional) ARN and security group ID of existing application load balancer to attach Gatus too. If unspecified then an ALB will be created."
type = object({
arn = string
security_group_id = string
})
default = null
}
variable "public" {
description = "(Optional) If `true` then containers will be assigned public IPs and ALB will be made public."
type = bool
default = false
}
variable "database" {
description = "(Optional) Database name and connection details. If set, these will be added to container environment variables for use in Gatus config. ARNs of Secret Manager secrets or Parameter Store parameters should be provided for `user` and `password`."
type = object({
host = string
port = number
name = string
user_arn = string
password_arn = string
})
default = null
}
variable "env_vars" {
description = "(Optional) Map of environment variables to add to the container. This can be referenced in the Gatus config files. e.g. `{ FRONT_END = \"https://example.com\" }`"
type = map(string)
default = {}
}
variable "secrets" {
description = "(Optional) Map of secrets to add to the container. The values should be ARNs for Secrets Manager or SSM Parameter Store"
type = map(string)
default = {}
}