-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvariables.tf
More file actions
261 lines (211 loc) · 7.57 KB
/
variables.tf
File metadata and controls
261 lines (211 loc) · 7.57 KB
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
variable "name_prefix" {
type = string
description = "Name to prefix on to the resources"
}
variable "account_id" {
type = string
description = "aws account id"
}
variable "region" {
type = string
default = "eu-west-2"
}
variable "mesh_env" {
type = string
description = "mesh environment (integration/production) .. will set the correct mesh url and egress cidrs for vpc lambdas too"
validation {
condition = var.mesh_env == "integration" || var.mesh_env == "production" || var.mesh_env == "local"
error_message = "mesh_env must be one of local/integration/production"
}
}
variable "verify_ssl" {
type = bool
default = true
description = "if false will set verify=false for requests to mesh (not recommended for production)"
}
variable "verify_checks_common_name" {
type = bool
default = true
description = "will allow ssl verify to check the certificate common name"
}
variable "use_secrets_manager" {
type = bool
default = false
description = "retrieve client certificate key and mailbox passwords from secrets manager rather than ssm"
}
variable "use_sender_filename" {
type = bool
default = false
description = "if true the inbound mex-filename will be used as the filename for storage in s3 rather than {message_id}.dat"
}
variable "use_s3_key_for_mex_filename" {
type = bool
default = false
description = "not recommended, if true the outgoing mex-filename header will be set using the os.path.basename(s3_object.key)"
}
variable "use_legacy_inbound_location" {
type = bool
default = false
description = "if true the INBOUND_BUCKET/INBOUND_FOLDER locations from SSM will be used rather than a default of s3://{mesh-bucket}/inbound/{mailbox_id}/{filename}"
}
variable "chunk_size" {
type = number
default = 20 * 1024 * 1024
description = "defines chunk_size used to partition send files when sending to MESH, applied before compression if your files are large and very compressible you may want to increase this"
validation {
condition = 0 < var.chunk_size
error_message = "must be greater than zero"
}
}
variable "crumb_size" {
type = number
default = null
description = "advanced, defines the s3 read/write buffer size ( should be lte chunk_size )"
validation {
condition = 0 < coalesce(var.crumb_size, 1)
error_message = "must be null or between zero and chunk_size"
}
}
variable "never_compress" {
type = bool
default = false
description = "advanced, if set true, we will never attempt to compress chunks before sending to MESH, if you data is always pre-compressed you may want to set this, but preferably set the content-encoding on the file when storing in s3"
}
variable "compress_threshold" {
type = number
default = 20 * 1024 * 1024
description = "advanced, defines the min size file to compress, set to zero to compress everything"
validation {
condition = 0 <= var.compress_threshold
error_message = "must be between zero and chunk_size"
}
}
variable "vpc_id" {
type = string
default = ""
description = "if set this will deploy the lambdas in the specified vpc and require VPC endpoints to access aws services"
}
variable "subnet_ids" {
type = set(string)
description = "subnet ids that the lambdas will be attached to in the vpc"
}
variable "mailboxes" {
description = "deprecated, legacy way of configuring outbound mappings"
# TODO: mailboxes config can be removed in a future major release (3.0.0)
type = list(object({
id = string
outbound_mappings = list(object({
dest_mailbox = string
workflow_id = string
}))
}))
default = []
}
variable "mailbox_ids" {
type = set(string)
description = "list of your MESH mailbox_ids to poll for new messages"
}
variable "cloudwatch_retention_in_days" {
description = "How many days to retain CloudWatch logs for"
type = number
default = 365
}
variable "cloudtrail_cloudwatch_log_retention_in_days" {
type = number
default = 30
description = "separate configuration of the cloudtrail log retention"
}
variable "s3logs_retention_in_days" {
description = "How many days to retain S3 object logs for"
type = number
default = 7
validation {
condition = var.s3logs_retention_in_days >= 1
error_message = "The s3logs_retention_in_days value must be greater than or equal to 1."
}
}
variable "get_messages_enabled" {
type = bool
default = true
description = "if set to false the poll for new messages will be disabled, you should 'almost never' set this or your mailbox(es) may overflow"
}
variable "mesh_s3_object_expiry_in_days" {
type = number
default = 60
description = "days to retain mesh message objects in the s3 bucket, objects will be marked as non-current after x days and permanently deleted x days after that"
}
variable "mesh_s3_object_expiry_enabled" {
type = bool
default = false
description = "recommended to set this to true and use alternative locations for long term storage of sent and received messages, where required"
}
variable "cloudtrail_enabled" {
type = bool
default = true
description = "set this to false for localstack (where cloudtrail is not supported), this should be set to true for AWS environments or send message triggers will not fire"
}
variable "get_message_max_concurrency" {
type = number
default = 1
description = "parallelism for get messages, if you are receiving lots of messages this may help achieve a higher throughput"
}
variable "get_messages_schedule" {
# https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
type = string
default = "rate(1 minute)"
description = "schedule on which to check for new messages, it's recommended this is quite frequent, but it can be tweaked."
}
variable "get_messages_page_limit" {
type = number
default = 500
description = "the number of message ids to pull back in a call to list messages for a mailbox"
}
variable "handshake_schedule" {
# https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
type = string
default = "rate(1 hour)"
description = "schedule on which to handshake with MESH, not recommended to do this more frequently than once per hour."
}
variable "fetch_message_ephemeral_storage_size" {
type = number
default = 10240
description = "this is in MiB so 1024 is 1GiB, retrieved chunks are buffered to disk in the receiving lambda function, if you are are receiving high volumes of smaller messages, you may want to lower this"
}
variable "aws_s3_endpoint_prefix_list_id" {
type = string
default = ""
}
variable "aws_ssm_endpoint_sg_id" {
type = string
default = ""
}
variable "aws_sfn_endpoint_sg_id" {
type = string
default = ""
}
variable "aws_logs_endpoints_sg_id" {
type = string
default = ""
}
variable "aws_kms_endpoints_sg_id" {
type = string
default = ""
}
variable "aws_lambda_endpoints_sg_id" {
type = string
default = ""
}
variable "aws_secrets_endpoints_sg_id" {
type = string
default = ""
}
variable "fetch_message_lambda_memory_size" {
type = number
default = 128
description = "Memory size (in MiB) for the fetch message Lambda. Increase if large files are expected."
}
variable "send_message_lambda_memory_size" {
type = number
default = 128
description = "Memory size (in MiB) for the send message Lambda"
}